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:
Jouni Malinen 2015-01-09 02:31:23 +02:00
parent 635874b55a
commit a354bcc886

View file

@ -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;
}