/pidgin/main: 581716bd2b64: Fix a couple small gg leaks - CID 73...

Daniel Atallah datallah at pidgin.im
Tue Oct 9 00:59:14 EDT 2012


Changeset: 581716bd2b641224cd76684fbdad788c8ee2cf82
Author:	 Daniel Atallah <datallah at pidgin.im>
Date:	 2012-10-09 00:58 -0400
Branch:	 release-2.x.y
URL: http://hg.pidgin.im/pidgin/main/rev/581716bd2b64

Description:

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

diffstat:

 libpurple/protocols/gg/gg.c     |  1 +
 libpurple/protocols/gg/search.c |  6 +++++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diffs (37 lines):

diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c
--- a/libpurple/protocols/gg/gg.c
+++ b/libpurple/protocols/gg/gg.c
@@ -2177,6 +2177,7 @@ static void ggp_login(PurpleAccount *acc
 
 		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");
 
diff --git a/libpurple/protocols/gg/search.c b/libpurple/protocols/gg/search.c
--- a/libpurple/protocols/gg/search.c
+++ b/libpurple/protocols/gg/search.c
@@ -138,6 +138,7 @@ guint32 ggp_search_start(PurpleConnectio
 	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 @@ guint32 ggp_search_start(PurpleConnectio
 	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;
 	}
 



More information about the Commits mailing list