From: Jouni Malinen Date: Sun, 16 Oct 2011 10:19:33 +0000 (+0300) Subject: dbus: Fix potential memory leak with unexpected p2p_find calls X-Git-Tag: hostap-1-bp~158 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b02897e70b7750da40ea5b2d6a02b3fbd6e0621f;p=thirdparty%2Fhostap.git dbus: Fix potential memory leak with unexpected p2p_find calls Should the RequestedDeviceTypes entry show up multiple times, the previously allocated buffer would have been leaked. --- diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c index 0ab755396..f2c5a1887 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c +++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c @@ -101,6 +101,7 @@ DBusMessage * wpas_dbus_handler_p2p_find(DBusMessage *message, (entry.array_type != WPAS_DBUS_TYPE_BINARRAY)) goto error_clear; + os_free(req_dev_types); req_dev_types = os_malloc(WPS_DEV_TYPE_LEN * entry.array_len); if (!req_dev_types)