未验证 提交 1fa5a86d 编写于 作者: O openharmony_ci 提交者: Gitee

!188 Judge null pointer

Merge pull request !188 from zyshg/master
......@@ -1955,6 +1955,10 @@ static int32_t WifiAddIf(void *priv, enum wpa_driver_if_type type, const char *i
return -EFAIL;
}
ifAdd = (WifiIfAdd *)os_zalloc(sizeof(WifiIfAdd));
if (ifAdd == NULL) {
wpa_printf(MSG_ERROR, "%s failed to alloc ifAdd.", __FUNCTION__);
return -EFAIL;
}
switch (type) {
case WPA_IF_STATION:
ifAdd->type = WIFI_IFTYPE_STATION;
......
......@@ -1960,6 +1960,10 @@ static int32_t WifiAddIf(void *priv, enum wpa_driver_if_type type, const char *i
return -EFAIL;
}
ifAdd = (WifiIfAdd *)os_zalloc(sizeof(WifiIfAdd));
if (ifAdd == NULL) {
wpa_printf(MSG_ERROR, "%s failed to alloc ifAdd.", __FUNCTION__);
return -EFAIL;
}
switch (type) {
case WPA_IF_STATION:
ifAdd->type = WIFI_IFTYPE_STATION;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册