From: Daniel Wagner Date: Fri, 17 Aug 2012 07:47:07 +0000 (+0200) Subject: dundee: Fix error code handling in add_device() X-Git-Tag: 1.6~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01bae4fdcd7e3cdd37d311156f4d20854aa79be0;p=platform%2Fupstream%2Fconnman.git dundee: Fix error code handling in add_device() 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. --- diff --git a/plugins/dundee.c b/plugins/dundee.c index ed611dd..0a48db1 100644 --- a/plugins/dundee.c +++ b/plugins/dundee.c @@ -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,