driver_ralink: Fixed couple of memory leaks on error path
This commit is contained in:
parent
a6ee047fcb
commit
d04cbdd640
1 changed files with 4 additions and 1 deletions
|
@ -611,8 +611,10 @@ wpa_driver_ralink_event_wireless(struct wpa_driver_ralink_data *drv,
|
||||||
"receive ReqIEs !!!");
|
"receive ReqIEs !!!");
|
||||||
drv->assoc_req_ies =
|
drv->assoc_req_ies =
|
||||||
os_malloc(iwe->u.data.length);
|
os_malloc(iwe->u.data.length);
|
||||||
if (drv->assoc_req_ies == NULL)
|
if (drv->assoc_req_ies == NULL) {
|
||||||
|
os_free(buf);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
drv->assoc_req_ies_len = iwe->u.data.length;
|
drv->assoc_req_ies_len = iwe->u.data.length;
|
||||||
os_memcpy(drv->assoc_req_ies, custom,
|
os_memcpy(drv->assoc_req_ies, custom,
|
||||||
|
@ -625,6 +627,7 @@ wpa_driver_ralink_event_wireless(struct wpa_driver_ralink_data *drv,
|
||||||
if (drv->assoc_resp_ies == NULL) {
|
if (drv->assoc_resp_ies == NULL) {
|
||||||
os_free(drv->assoc_req_ies);
|
os_free(drv->assoc_req_ies);
|
||||||
drv->assoc_req_ies = NULL;
|
drv->assoc_req_ies = NULL;
|
||||||
|
os_free(buf);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue