changeset 21016:abd768f06e7b

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)
author Ka-Hing Cheung <khc@hxbc.us>
date Fri, 26 Oct 2007 05:22:26 +0000
parents 787b3897ba9f
children f710e48fbe1b
files libpurple/protocols/yahoo/yahoo_aliases.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo_aliases.c	Fri Oct 26 04:59:23 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo_aliases.c	Fri Oct 26 05:22:26 2007 +0000
@@ -139,8 +139,8 @@
 {
 	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 @@
 	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 @@
 		yd->url_datas = g_slist_prepend(yd->url_datas, url_data);
 	}
 
-	g_free(url);
+	g_free(webaddress);
+	g_free(webpage);
 	g_free(request);
 }