未验证 提交 6a128da4 编写于 作者: O openharmony_ci 提交者: Gitee

!76 Cannot return null if no device can be scanned in function WifiWpaGetScanResults2

Merge pull request !76 from 毛宇锋/master
......@@ -1168,9 +1168,7 @@ static struct wpa_scan_results *WifiWpaGetScanResults2(void *priv)
results->num = drv->scanNum;
if (results->num == 0) {
os_free(results);
results = NULL;
return NULL;
return results;
}
results->res = (struct wpa_scan_res **)os_zalloc(results->num * sizeof(struct wpa_scan_res *));
if (results->res == NULL) {
......
......@@ -1168,9 +1168,7 @@ static struct wpa_scan_results *WifiWpaGetScanResults2(void *priv)
results->num = drv->scanNum;
if (results->num == 0) {
os_free(results);
results = NULL;
return NULL;
return results;
}
results->res = (struct wpa_scan_res **)os_zalloc(results->num * sizeof(struct wpa_scan_res *));
if (results->res == NULL) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册