dundee: Fix error code handling in add_device()
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Fri, 17 Aug 2012 07:47:07 +0000 (09:47 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 17 Aug 2012 10:01:56 +0000 (13:01 +0300)
If no error happens then we should just return and not run
into the cleanup code. And when we cleanup we should not double
free pointers.

plugins/dundee.c

index ed611dd..0a48db1 100644 (file)
@@ -632,12 +632,10 @@ static void add_device(const char *path, DBusMessageIter *properties)
        if (info->active == TRUE)
                set_connected(info);
 
+       return;
+
 out:
        g_hash_table_remove(dundee_devices, path);
-
-       g_free(info->path);
-       g_free(info->name);
-       g_free(info);
 }
 
 static gboolean device_added(DBusConnection *conn, DBusMessage *message,