]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
dbus: Fix a NULL pointer dereference on error path
authorJouni Malinen <jouni.malinen@atheros.com>
Tue, 10 Nov 2009 16:08:55 +0000 (18:08 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 10 Nov 2009 16:08:55 +0000 (18:08 +0200)
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.

wpa_supplicant/ctrl_iface_dbus_new_handlers.c

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