]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Fix memory leak on start radar detection error path
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>
Fri, 26 Sep 2014 18:21:25 +0000 (20:21 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 28 Sep 2014 08:03:48 +0000 (11:03 +0300)
Free nlmsg if failing to start radar detection.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
src/drivers/driver_nl80211.c

index 682ec680dba2bf34580c09caf3ffb2f0928f8745..26e31a3a8547dd2dfe37b86bba8825348a67875a 100644 (file)
@@ -11527,11 +11527,13 @@ static int nl80211_start_radar_detection(void *priv,
                goto nla_put_failure;
 
        ret = send_and_recv_msgs(drv, msg, NULL, NULL);
+       msg = NULL;
        if (ret == 0)
                return 0;
        wpa_printf(MSG_DEBUG, "nl80211: Failed to start radar detection: "
                   "%d (%s)", ret, strerror(-ret));
 nla_put_failure:
+       nlmsg_free(msg);
        return -1;
 }