aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2019-05-08 19:06:46 (GMT)
committerJouni Malinen <j@w1.fi>2019-05-08 19:06:46 (GMT)
commita96c7836451860f93f88bd739c132645dd581af1 (patch)
tree9c707321de5acfa5661f2b85ddae432eb900d737
parente3b39e62c2ded588943190c941084e4a08701bdf (diff)
downloadhostap-a96c7836451860f93f88bd739c132645dd581af1.zip
hostap-a96c7836451860f93f88bd739c132645dd581af1.tar.gz
hostap-a96c7836451860f93f88bd739c132645dd581af1.tar.bz2
dbus: Fix some memory leaks on error paths
wpa_dbus_dict_close_write() was not called if fill_dict_with_properties() fails and that could result in leaking memory. Fix this in two cases. There might be other missing calls to jouni@codeaurora.org() on error paths, but those will need to be handled separately with more complex changes. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
-rw-r--r--wpa_supplicant/dbus/dbus_new_helpers.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_helpers.c b/wpa_supplicant/dbus/dbus_new_helpers.c
index 0115e32..d80e2d4 100644
--- a/wpa_supplicant/dbus/dbus_new_helpers.c
+++ b/wpa_supplicant/dbus/dbus_new_helpers.c
@@ -98,6 +98,7 @@ static DBusMessage * get_all_properties(DBusMessage *message, char *interface,
dbus_error_init(&error);
if (!fill_dict_with_properties(&dict_iter, obj_dsc->properties,
interface, obj_dsc->user_data, &error)) {
+ wpa_dbus_dict_close_write(&iter, &dict_iter);
dbus_message_unref(reply);
reply = wpas_dbus_reply_new_from_error(
message, &error, DBUS_ERROR_INVALID_ARGS,
@@ -930,6 +931,7 @@ dbus_bool_t wpa_dbus_get_object_properties(struct wpas_dbus_priv *iface,
dbus_error_is_set(&error) ? error.name : "none",
dbus_error_is_set(&error) ? error.message : "none");
dbus_error_free(&error);
+ wpa_dbus_dict_close_write(iter, &dict_iter);
return FALSE;
}