pidgin.next.minor: 62f07bce: Cleanup the GNOME URL registration code

rlaager at pidgin.im rlaager at pidgin.im
Tue Dec 2 13:50:27 EST 2008


-----------------------------------------------------------------
Revision: 62f07bce9cd9815006906e75cfa946c585d9ebdf
Ancestor: d7098503694dfc998e07e1bff47226c7d5f623b4
Author: sadrul at pidgin.im
Date: 2008-12-02T17:20:28
Branch: im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/62f07bce9cd9815006906e75cfa946c585d9ebdf

Modified files:
        pidgin/gtkutils.c

ChangeLog: 

Cleanup the GNOME URL registration code

-------------- next part --------------
============================================================
--- pidgin/gtkutils.c	dac95e5312168e0b155ac0f67ffacbfdc0cd24e6
+++ pidgin/gtkutils.c	8607b3874f6be1e9c4994f88278efd28c46351d0
@@ -74,7 +74,7 @@ static guint accels_save_timer = 0;
 } 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
 }
 
 static gboolean
-register_gnome_url_handlers()
+register_gnome_url_handlers(void)
 {
 	char *tmp;
 	char *err;
@@ -3585,6 +3585,7 @@ register_gnome_url_handlers()
 	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 @@ register_gnome_url_handlers()
 				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 @@ register_gnome_url_handlers()
 			start = c + 1;
 		}
 	}
+	g_free(tmp);
 
 	return (gnome_url_handlers != NULL);
 }


More information about the Commits mailing list