Parcourir la source

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.
Jouni Malinen il y a 15 ans
Parent
commit
4f93ab0ffc
1 fichiers modifiés avec 2 ajouts et 3 suppressions
  1. 2 3
      wpa_supplicant/ctrl_iface_dbus_new_handlers.c

+ 2 - 3
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)