changeset 25356:726b251cb913

Cleanup the GNOME URL registration code committer: Richard Laager <rlaager@wiktel.com>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 02 Dec 2008 17:20:28 +0000
parents c6f7143cc7f4
children b01a7f17a2bb
files pidgin/gtkutils.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkutils.c	Tue Dec 02 17:14:54 2008 +0000
+++ b/pidgin/gtkutils.c	Tue Dec 02 17:20:28 2008 +0000
@@ -74,7 +74,7 @@
 } AopMenu;
 
 static guint accels_save_timer = 0;
-GList *gnome_url_handlers = NULL;
+static GList *gnome_url_handlers = NULL;
 
 static gboolean
 url_clicked_idle_cb(gpointer data)
@@ -3570,7 +3570,7 @@
 }
 
 static gboolean
-register_gnome_url_handlers()
+register_gnome_url_handlers(void)
 {
 	char *tmp;
 	char *err;
@@ -3585,6 +3585,7 @@
 	if (!g_spawn_command_line_sync("gconftool-2 --all-dirs /desktop/gnome/url-handlers",
 	                               &tmp, &err, NULL, NULL))
 	{
+		g_free(tmp);
 		g_free(err);
 		g_return_val_if_reached(FALSE);
 	}
@@ -3610,15 +3611,17 @@
 				if (g_spawn_command_line_sync(cmd, &tmp2, &err, NULL, NULL))
 				{
 					g_free(err);
+					err = NULL;
 					if (!strcmp(tmp2, "false\n"))
 					{
 						g_free(tmp2);
+						g_free(cmd);
 						start = c + 1;
 						continue;
 					}
-					else
-						g_free(tmp2);
 				}
+				g_free(cmd);
+				g_free(tmp2);
 
 				start += sizeof("/desktop/gnome/url-handlers/") - 1;
 
@@ -3642,6 +3645,7 @@
 			start = c + 1;
 		}
 	}
+	g_free(tmp);
 
 	return (gnome_url_handlers != NULL);
 }