]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix a couple memory leaks
authorPaul Stewart <pstew@chromium.org>
Sat, 4 Aug 2012 17:10:08 +0000 (20:10 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 4 Aug 2012 17:10:08 +0000 (20:10 +0300)
Found using valgrind.

Signed-hostap: Paul Stewart <pstew@chromium.org>

src/drivers/driver_nl80211.c
wpa_supplicant/dbus/dbus_new_handlers.c

index 8b0a5f7152d7f917eea95a09f9728e59dfea7767..36cdbc82663b7d7e2e4a7abe82ff297e5f2d251d 100644 (file)
@@ -8465,12 +8465,15 @@ static int nl80211_signal_monitor(void *priv, int threshold, int hysteresis)
 
        cqm = nlmsg_alloc();
        if (cqm == NULL)
-               return -1;
+               goto nla_put_failure;
 
        NLA_PUT_U32(cqm, NL80211_ATTR_CQM_RSSI_THOLD, threshold);
        NLA_PUT_U32(cqm, NL80211_ATTR_CQM_RSSI_HYST, hysteresis);
        nla_put_nested(msg, NL80211_ATTR_CQM, cqm);
 
+       nlmsg_free(cqm);
+       cqm = NULL;
+
        if (send_and_recv_msgs(drv, msg, NULL, NULL) == 0)
                return 0;
        msg = NULL;
index 8145a702938f3a8fb74d32d0367232b913588099..3f895cfde32178496f8e4b4dbadad2375f3b13ee 100644 (file)
@@ -609,6 +609,7 @@ DBusMessage * wpas_dbus_handler_create_interface(DBusMessage *message,
 out:
        os_free(driver);
        os_free(ifname);
+       os_free(confname);
        os_free(bridge_ifname);
        return reply;