mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
D-Bus: Use NoMemory error message from CreateInterface
Try to be a bit more consistent by using NoMemory instead of InvalidArgs if os_strdup() fails in the CreateInterface handler. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
635874b55a
commit
a354bcc886
@ -537,28 +537,28 @@ DBusMessage * wpas_dbus_handler_create_interface(DBusMessage *message,
|
||||
driver = os_strdup(entry.str_value);
|
||||
wpa_dbus_dict_entry_clear(&entry);
|
||||
if (driver == NULL)
|
||||
goto error;
|
||||
goto oom;
|
||||
} else if (os_strcmp(entry.key, "Ifname") == 0 &&
|
||||
entry.type == DBUS_TYPE_STRING) {
|
||||
os_free(ifname);
|
||||
ifname = os_strdup(entry.str_value);
|
||||
wpa_dbus_dict_entry_clear(&entry);
|
||||
if (ifname == NULL)
|
||||
goto error;
|
||||
goto oom;
|
||||
} else if (os_strcmp(entry.key, "ConfigFile") == 0 &&
|
||||
entry.type == DBUS_TYPE_STRING) {
|
||||
os_free(confname);
|
||||
confname = os_strdup(entry.str_value);
|
||||
wpa_dbus_dict_entry_clear(&entry);
|
||||
if (confname == NULL)
|
||||
goto error;
|
||||
goto oom;
|
||||
} else if (os_strcmp(entry.key, "BridgeIfname") == 0 &&
|
||||
entry.type == DBUS_TYPE_STRING) {
|
||||
os_free(bridge_ifname);
|
||||
bridge_ifname = os_strdup(entry.str_value);
|
||||
wpa_dbus_dict_entry_clear(&entry);
|
||||
if (bridge_ifname == NULL)
|
||||
goto error;
|
||||
goto oom;
|
||||
} else {
|
||||
wpa_dbus_dict_entry_clear(&entry);
|
||||
goto error;
|
||||
@ -610,6 +610,9 @@ out:
|
||||
error:
|
||||
reply = wpas_dbus_error_invalid_args(message, NULL);
|
||||
goto out;
|
||||
oom:
|
||||
reply = wpas_dbus_error_no_memory(message);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user