From 6467734c50eb71e59bbacfa2baf5b9ccfa3e1c2b Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 1 Dec 2011 11:54:16 -0500 Subject: serverList_equal: We have to compare IndicateListenerServers by DBus path instead of just name. This fixes issues where one client (DBus name) will create two or more indicate servers. --- src/messages-service.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/messages-service.c') diff --git a/src/messages-service.c b/src/messages-service.c index e8fe576..44e922e 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -104,10 +104,15 @@ serverList_equal (gconstpointer a, gconstpointer b) pa = (serverList_t *)a; pb = (serverList_t *)b; - const gchar * pas = INDICATE_LISTENER_SERVER_DBUS_NAME(pa->server); - const gchar * pbs = INDICATE_LISTENER_SERVER_DBUS_NAME(pb->server); - - return g_strcmp0(pas, pbs); + const gchar * pan = INDICATE_LISTENER_SERVER_DBUS_NAME(pa->server); + const gchar * pbn = INDICATE_LISTENER_SERVER_DBUS_NAME(pb->server); + const gchar * pap = indicate_listener_server_get_dbuspath(pa->server); + const gchar * pbp = indicate_listener_server_get_dbuspath(pb->server); + + if (g_strcmp0(pan, pbn) == 0) + return g_strcmp0(pap, pbp); + else + return 1; } static gint -- cgit v1.2.3 From 817be57dddbcc9e9b8935bb65e95b91dd6ca03f0 Mon Sep 17 00:00:00 2001 From: Daniel d'Andrada Date: Wed, 8 Feb 2012 18:42:36 -0200 Subject: Fix memory leak: Free path string. The path was being created in build_launchers (line 1427) but never freed. --- src/messages-service.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/messages-service.c') diff --git a/src/messages-service.c b/src/messages-service.c index 44e922e..a21435c 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -1301,6 +1301,7 @@ build_launcher (gpointer data) g_file_get_contents(path, &desktop, NULL, NULL); if (desktop == NULL) { + g_free(path); return FALSE; } @@ -1310,6 +1311,7 @@ build_launcher (gpointer data) build_launcher_core(trimdesktop); g_free(trimdesktop); + g_free(path); return FALSE; } @@ -1323,6 +1325,7 @@ build_launcher_keyfile (gpointer data) build_launcher_core(desktop); g_free(desktop); } + g_free(path); return FALSE; } -- cgit v1.2.3