Fix a couple small gg leaks - CID 732083, 732084 and one more that I noticed release-2.x.y

Tue, 09 Oct 2012 00:58:01 -0400

author
Daniel Atallah <datallah@pidgin.im>
date
Tue, 09 Oct 2012 00:58:01 -0400
branch
release-2.x.y
changeset 33422
581716bd2b64
parent 33421
c10f36e28024
child 33471
b120a1fe399e
child 33601
910e26960232

Fix a couple small gg leaks - CID 732083, 732084 and one more that I noticed

libpurple/protocols/gg/gg.c file | annotate | diff | comparison | revisions
libpurple/protocols/gg/search.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/gg/gg.c	Mon Oct 08 23:54:45 2012 -0400
+++ b/libpurple/protocols/gg/gg.c	Tue Oct 09 00:58:01 2012 -0400
@@ -2177,6 +2177,7 @@
 
 		glp->server_addr = inet_addr(inet_ntoa(*addr));
 		glp->server_port = 8074;
+		free(addr);
 	} else
 		purple_debug_info("gg", "Trying to retrieve address from gg appmsg service\n");
 
--- a/libpurple/protocols/gg/search.c	Mon Oct 08 23:54:45 2012 -0400
+++ b/libpurple/protocols/gg/search.c	Tue Oct 09 00:58:01 2012 -0400
@@ -138,6 +138,7 @@
 	GGPInfo *info = gc->proto_data;
 	gg_pubdir50_t req;
 	guint seq, offset;
+	gchar *tmp;
 
 	purple_debug_info("gg", "It's time to perform a search...\n");
 
@@ -190,10 +191,13 @@
 	offset = form->page_size * form->page_number;
 	purple_debug_info("gg", "page number: %u, page size: %u, offset: %u\n",
 		form->page_number, form->page_size, offset);
-	gg_pubdir50_add(req, GG_PUBDIR50_START, g_strdup_printf("%u", offset));
+	tmp = g_strdup_printf("%u", offset);
+	gg_pubdir50_add(req, GG_PUBDIR50_START, tmp);
+	g_free(tmp);
 
 	if ((seq = gg_pubdir50(info->session, req)) == 0) {
 		purple_debug_warning("gg", "ggp_bmenu_show_details: Search failed.\n");
+		gg_pubdir50_free(req);
 		return 0;
 	}
 

mercurial