dbus: Fix a NULL pointer dereference on error path

The cleanup routine in the end would have dereferenced props pointer
which could be NULL. There is no need to go through that cleanup code
in this case, so just exit from the function with return instead.
This commit is contained in:
Jouni Malinen 2009-11-10 18:08:55 +02:00 committed by Jouni Malinen
parent a1641d2671
commit 4f93ab0ffc

View File

@ -3036,9 +3036,8 @@ DBusMessage * wpas_dbus_getter_network_properties(
if (!props) { if (!props) {
perror("wpas_dbus_getter_network_properties[dbus] couldn't " perror("wpas_dbus_getter_network_properties[dbus] couldn't "
"read network properties. out of memory."); "read network properties. out of memory.");
reply = dbus_message_new_error(message, DBUS_ERROR_NO_MEMORY, return dbus_message_new_error(message, DBUS_ERROR_NO_MEMORY,
NULL); NULL);
goto out;
} }
if (message == NULL) if (message == NULL)