From: Benjamin Berg Date: Thu, 30 Oct 2025 08:24:33 +0000 (+0100) Subject: nl80211: Put nl_cb in error paths X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=172ee21bc702243584c29afd634a57f52daa4c90;p=thirdparty%2Fhostap.git nl80211: Put nl_cb in error paths The newly allocated nl_cb object needs to be freed if there is an error. Fixes: e32ad281ca39 ("nl80211: Register for Beacon frames in AP mode") Signed-off-by: Benjamin Berg --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 998ade6fe..24516637e 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -1084,12 +1084,14 @@ nl80211_get_wiphy_data_ap(struct i802_bss *bss) w->nl_beacons = nl_create_handle(bss->drv->global->nl_cb, "wiphy beacons"); if (w->nl_beacons == NULL) { + nl_cb_put(w->nl_cb); os_free(w); return NULL; } if (nl80211_register_beacons(bss->drv, w)) { nl_destroy_handles(&w->nl_beacons); + nl_cb_put(w->nl_cb); os_free(w); return NULL; }