pidgin: f32f9fb1: Fix a double free. Fixes #7047

nosnilmot at pidgin.im nosnilmot at pidgin.im
Tue Sep 16 09:10:29 EDT 2008


-----------------------------------------------------------------
Revision: f32f9fb19ff7b4685994c4120991d00386efee39
Ancestor: d8efe65e6fb17e66001bd2d37b7e05bf864e44cc
Author: nosnilmot at pidgin.im
Date: 2008-09-16T13:04:39
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f32f9fb19ff7b4685994c4120991d00386efee39

Modified files:
        libpurple/proxy.c

ChangeLog: 

Fix a double free. Fixes #7047

-------------- next part --------------
============================================================
--- libpurple/proxy.c	b7dbb41f68625d6ea47613e3198d6ddfe6d382a9
+++ libpurple/proxy.c	67a1948a059b1f6d1f69ac9a5c3aa6fba3a083c5
@@ -263,13 +263,17 @@ purple_gnome_proxy_get_info(void)
 		use_same_proxy = TRUE;
 	g_free(tmp);
 
-	if (!use_same_proxy && !g_spawn_command_line_sync("gconftool-2 -g /system/proxy/socks_host",
+	if (!use_same_proxy) {
+		if (!g_spawn_command_line_sync("gconftool-2 -g /system/proxy/socks_host",
 			&info.host, &err, NULL, NULL))
-		return purple_global_proxy_get_info();
-	g_free(err);
-	g_strchomp(info.host);
+			return purple_global_proxy_get_info();
+		g_free(err);
+	}
 
-	if (!use_same_proxy && *info.host != '\0') {
+	if(info.host != NULL)
+		g_strchomp(info.host);
+
+	if (!use_same_proxy && (info.host != NULL) && (*info.host != '\0')) {
 		info.type = PURPLE_PROXY_SOCKS5;
 		if (!g_spawn_command_line_sync("gconftool-2 -g /system/proxy/socks_port",
 				&tmp, &err, NULL, NULL))


More information about the Commits mailing list