From: Jouni Malinen Date: Tue, 10 Nov 2009 16:08:55 +0000 (+0200) Subject: dbus: Fix a NULL pointer dereference on error path X-Git-Tag: hostap_0_7_0~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f93ab0ffca778212c5996f10515a7481c8cfd56;p=thirdparty%2Fhostap.git 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. --- diff --git a/wpa_supplicant/ctrl_iface_dbus_new_handlers.c b/wpa_supplicant/ctrl_iface_dbus_new_handlers.c index 59c29921f..acf39f7e3 100644 --- a/wpa_supplicant/ctrl_iface_dbus_new_handlers.c +++ b/wpa_supplicant/ctrl_iface_dbus_new_handlers.c @@ -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)