Fix memory leak on rfkill init error path

This commit is contained in:
Jouni Malinen 2010-05-25 12:06:25 +03:00 committed by Jouni Malinen
parent 8c0ef18199
commit 5216938960
2 changed files with 6 additions and 2 deletions

View file

@ -1426,8 +1426,10 @@ static void * wpa_driver_nl80211_init(void *ctx, const char *ifname)
rcfg->blocked_cb = wpa_driver_nl80211_rfkill_blocked;
rcfg->unblocked_cb = wpa_driver_nl80211_rfkill_unblocked;
drv->rfkill = rfkill_init(rcfg);
if (drv->rfkill == NULL)
if (drv->rfkill == NULL) {
wpa_printf(MSG_DEBUG, "nl80211: RFKILL status not available");
os_free(rcfg);
}
if (wpa_driver_nl80211_finish_drv_init(drv))
goto failed;

View file

@ -762,8 +762,10 @@ void * wpa_driver_wext_init(void *ctx, const char *ifname)
rcfg->blocked_cb = wpa_driver_wext_rfkill_blocked;
rcfg->unblocked_cb = wpa_driver_wext_rfkill_unblocked;
drv->rfkill = rfkill_init(rcfg);
if (drv->rfkill == NULL)
if (drv->rfkill == NULL) {
wpa_printf(MSG_DEBUG, "WEXT: RFKILL status not available");
os_free(rcfg);
}
drv->mlme_sock = -1;