From d04cbdd640fb52d2b0594bc7d1c279adf2c780d8 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 27 Feb 2008 17:52:05 -0800 Subject: [PATCH] driver_ralink: Fixed couple of memory leaks on error path --- src/drivers/driver_ralink.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver_ralink.c b/src/drivers/driver_ralink.c index 320ce4620..73fa94830 100644 --- a/src/drivers/driver_ralink.c +++ b/src/drivers/driver_ralink.c @@ -611,8 +611,10 @@ wpa_driver_ralink_event_wireless(struct wpa_driver_ralink_data *drv, "receive ReqIEs !!!"); drv->assoc_req_ies = os_malloc(iwe->u.data.length); - if (drv->assoc_req_ies == NULL) + if (drv->assoc_req_ies == NULL) { + os_free(buf); return; + } drv->assoc_req_ies_len = iwe->u.data.length; 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) { os_free(drv->assoc_req_ies); drv->assoc_req_ies = NULL; + os_free(buf); return; }