pidgin: 9a5b9a75: Bring back the lines that free info.what...

markdoliner at pidgin.im markdoliner at pidgin.im
Wed Mar 5 13:21:08 EST 2008


-----------------------------------------------------------------
Revision: 9a5b9a755769ed5ce1855edc6f94e7a1afc35313
Ancestor: 4e0326ec8a891601a265f9ee9a18358cc57cc4ac
Author: markdoliner at pidgin.im
Date: 2008-03-05T18:17:25
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/9a5b9a755769ed5ce1855edc6f94e7a1afc35313

Modified files:
        libpurple/proxy.c

ChangeLog: 

Bring back the lines that free info.whatever on subsequent calls to
purple_gnome_proxy_get_info().  Stu pointed out that they ARE needed
because 'info' is a static variable.

I should have merged these back into the function when I disapproved
of d5ef30aafa0c0ecff773017ab7ac542f9ba7b4b4, but holy cow that was a
crazy 3-way merge.

-------------- next part --------------
============================================================
--- libpurple/proxy.c	a9c19b74358163c6be714ad9d454969ae81dc69c
+++ libpurple/proxy.c	685db0075d95b756a8c31961210d6164a966d609
@@ -241,6 +241,20 @@ purple_gnome_proxy_get_info(void)
 	/* If we get this far then we know we're using an HTTP proxy */
 	info.type = PURPLE_PROXY_HTTP;
 
+	/* Free the old fields */
+	if (info.host) {
+		g_free(info.host);
+		info.host = NULL;
+	}
+	if (info.username) {
+		g_free(info.username);
+		info.username = NULL;
+	}
+	if (info.password) {
+		g_free(info.password);
+		info.password = NULL;
+	}
+
 	if (!g_spawn_command_line_sync("gconftool-2 -g /system/http_proxy/host",
 			&info.host, NULL, NULL, NULL))
 		return purple_global_proxy_get_info();


More information about the Commits mailing list