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.
This commit is contained in:
Jouni Malinen 2011-10-16 13:19:33 +03:00
parent 86c6626c5b
commit b02897e70b

View file

@ -101,6 +101,7 @@ DBusMessage * wpas_dbus_handler_p2p_find(DBusMessage *message,
(entry.array_type != WPAS_DBUS_TYPE_BINARRAY)) (entry.array_type != WPAS_DBUS_TYPE_BINARRAY))
goto error_clear; goto error_clear;
os_free(req_dev_types);
req_dev_types = req_dev_types =
os_malloc(WPS_DEV_TYPE_LEN * entry.array_len); os_malloc(WPS_DEV_TYPE_LEN * entry.array_len);
if (!req_dev_types) if (!req_dev_types)