Patchwork Fix a couple memory leaks

login
register
mail settings
Submitter Paul Stewart
Date June 7, 2012, 2 a.m.
Message ID <20120607021318.7F49820432@glenhelen.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/163454/
State Superseded
Headers show

Comments

Paul Stewart - June 7, 2012, 2 a.m.
Found using valgrind.

Signed-hostap: Paul Stewart <pstew@chromium.org>
---
 src/drivers/driver_nl80211.c            |    3 ++-
 wpa_supplicant/dbus/dbus_new_handlers.c |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 92a7de0..bb6e1d3 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -8403,12 +8403,13 @@  static int nl80211_signal_monitor(void *priv, int threshold, int hysteresis)
 	NLA_PUT_U32(cqm, NL80211_ATTR_CQM_RSSI_HYST, hysteresis);
 	nla_put_nested(msg, NL80211_ATTR_CQM, cqm);
 
+	nlmsg_free(cqm);
+
 	if (send_and_recv_msgs(drv, msg, NULL, NULL) == 0)
 		return 0;
 	msg = NULL;
 
 nla_put_failure:
-	nlmsg_free(cqm);
 	nlmsg_free(msg);
 	return -1;
 }
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index 3a5bcab..4cab426 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -614,6 +614,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;