D-Bus (old): Fix message handler error paths
authorJouni Malinen <j@w1.fi>
Tue, 6 Jan 2015 11:22:06 +0000 (13:22 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 7 Jan 2015 11:19:00 +0000 (13:19 +0200)
The error reply needs to be sent out as a response. The "out" label was
in incorrect place to allow that to happen; instead, it ended up leaking
memory for the generated reply message.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/dbus/dbus_old.c

index 2899132..1c85686 100644 (file)
@@ -292,13 +292,13 @@ static DBusHandlerResult wpas_iface_message_handler(DBusConnection *connection,
        }
 
        /* If the message was handled, send back the reply */
+out:
        if (reply) {
                if (!dbus_message_get_no_reply(message))
                        dbus_connection_send(connection, reply, NULL);
                dbus_message_unref(reply);
        }
 
-out:
        os_free(iface_obj_path);
        os_free(network);
        os_free(bssid);