im.pidgin.pidgin: 5d1f7fb3ad5d13827b161c3d115fb82e9826fe2c

khc at pidgin.im khc at pidgin.im
Fri Oct 26 01:25:39 EDT 2007


-----------------------------------------------------------------
Revision: 5d1f7fb3ad5d13827b161c3d115fb82e9826fe2c
Ancestor: 624a8a3a5fd07708e24e8238a0d745c857ca9c72
Author: khc at pidgin.im
Date: 2007-10-26T05:22:26
Branch: im.pidgin.pidgin

Modified files:
        libpurple/protocols/yahoo/yahoo_aliases.c

ChangeLog: 

Another patch from Andrew Gaul that plugs a leak:

==15182== 163 bytes in 5 blocks are definitely lost in loss record 116 of 231
==15182==    at 0x40054E5: malloc (vg_replace_malloc.c:149)
==15182==    by 0xBFFC25: g_malloc (in /lib/libglib-2.0.so.0.1200.13)
==15182==    by 0xC132B8: g_strdup (in /lib/libglib-2.0.so.0.1200.13)
==15182==    by 0x40A7B9F: purple_url_parse (util.c:3460)
==15182==    by 0x4C58C89: yahoo_fetch_aliases (yahoo_aliases.c:152)


-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo_aliases.c	a3f042baa93abd7c47e56377811e54d9b6d5e4b9
+++ libpurple/protocols/yahoo/yahoo_aliases.c	6c500c519679c800f3a43df22d8fb28f603dbed5
@@ -139,8 +139,8 @@ yahoo_fetch_aliases(PurpleConnection *gc
 {
 	struct yahoo_data *yd = gc->proto_data;
 	struct callback_data *cb;
-	char *url, *request, *webpage, *webaddress, *strtmp;
-	int inttmp;
+	const char *url = YAHOO_ALIAS_FETCH_URL;
+	char *request, *webpage, *webaddress;
 	PurpleUtilFetchUrlData *url_data;
 
 	/* Using callback_data so I have access to gc in the callback function */
@@ -148,8 +148,7 @@ yahoo_fetch_aliases(PurpleConnection *gc
 	cb->gc = gc;
 
 	/*  Build all the info to make the web request */
-	url = g_strdup(YAHOO_ALIAS_FETCH_URL);
-	purple_url_parse(url, &webaddress, &inttmp, &webpage, &strtmp, &strtmp);
+	purple_url_parse(url, &webaddress, NULL, &webpage, NULL, NULL);
 	request = g_strdup_printf("GET /%s HTTP/1.1\r\n"
 				 "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5)\r\n"
 				 "Cookie: T=%s; Y=%s\r\n"
@@ -163,7 +162,8 @@ yahoo_fetch_aliases(PurpleConnection *gc
 		yd->url_datas = g_slist_prepend(yd->url_datas, url_data);
 	}
 
-	g_free(url);
+	g_free(webaddress);
+	g_free(webpage);
 	g_free(request);
 }
 


More information about the Commits mailing list