mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
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>
This commit is contained in:
parent
e3b39e62c2
commit
a96c783645
@ -98,6 +98,7 @@ static DBusMessage * get_all_properties(DBusMessage *message, char *interface,
|
|||||||
dbus_error_init(&error);
|
dbus_error_init(&error);
|
||||||
if (!fill_dict_with_properties(&dict_iter, obj_dsc->properties,
|
if (!fill_dict_with_properties(&dict_iter, obj_dsc->properties,
|
||||||
interface, obj_dsc->user_data, &error)) {
|
interface, obj_dsc->user_data, &error)) {
|
||||||
|
wpa_dbus_dict_close_write(&iter, &dict_iter);
|
||||||
dbus_message_unref(reply);
|
dbus_message_unref(reply);
|
||||||
reply = wpas_dbus_reply_new_from_error(
|
reply = wpas_dbus_reply_new_from_error(
|
||||||
message, &error, DBUS_ERROR_INVALID_ARGS,
|
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.name : "none",
|
||||||
dbus_error_is_set(&error) ? error.message : "none");
|
dbus_error_is_set(&error) ? error.message : "none");
|
||||||
dbus_error_free(&error);
|
dbus_error_free(&error);
|
||||||
|
wpa_dbus_dict_close_write(iter, &dict_iter);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user