Fix memory leak on rfkill init error path
This commit is contained in:
parent
8c0ef18199
commit
5216938960
2 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue