]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
dbus_new_handlers: Omit errant dbus_message_unref
authorPaul Stewart <pstew@google.com>
Sat, 4 Dec 2010 19:58:44 +0000 (11:58 -0800)
committerJouni Malinen <j@w1.fi>
Sat, 4 Dec 2010 19:58:44 +0000 (11:58 -0800)
This unref is guaranteed to be freeing a NULL pointer.

Tested manually: use dbus-send to send an invalid debug level parameter

Before change:

$ dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply
/fi/w1/wpa_supplicant1 org.freedesktop.DBus.Properties.Set
string:fi.w1.wpa_supplicant1 string:DebugLevel variant:string:msgdumpf
Error org.freedesktop.DBus.Error.NoReply: Message did not receive a reply
(timeout by message bus)
(and then wpa_supplicant crashes)

After change:

$ dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply
/fi/w1/wpa_supplicant1 org.freedesktop.DBus.Properties.Set
string:fi.w1.wpa_supplicant1 string:DebugLevel variant:string:msgdumpf
Error fi.w1.wpa_supplicant1.InvalidArgs: Did not receive correct message
arguments.

Signed-off-by: Paul Stewart <pstew@google.com>
wpa_supplicant/dbus/dbus_new_handlers.c

index 0ad51a03faa4472b2435e1120a2f75098635e360..08cdd72ade0665759af29bf23dce83bb5d334c12 100644 (file)
@@ -803,7 +803,6 @@ DBusMessage * wpas_dbus_setter_debug_level(DBusMessage *message,
        if (val < 0 ||
            wpa_supplicant_set_debug_params(global, val, wpa_debug_timestamp,
                                            wpa_debug_show_keys)) {
-               dbus_message_unref(reply);
                return wpas_dbus_error_invalid_args(
                        message, "Wrong debug level value");
        }