im.pidgin.pidgin: 5b7828dc1104f008a8d07ab8374a7f3501f4c104

datallah at pidgin.im datallah at pidgin.im
Thu Oct 18 21:45:39 EDT 2007


-----------------------------------------------------------------
Revision: 5b7828dc1104f008a8d07ab8374a7f3501f4c104
Ancestor: 2907a074c5a977fcfe123292bbde28f0b16296f7
Author: datallah at pidgin.im
Date: 2007-10-19T01:28:55
Branch: im.pidgin.pidgin

Modified files:
        libpurple/protocols/msn/msn.c
        libpurple/protocols/msn/msnutils.c
        libpurple/protocols/msn/slp.c

ChangeLog: 

Leak fixes.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msn.c	b07df2bd8dd167a626174dba019f64ed3fed755c
+++ libpurple/protocols/msn/msn.c	9de650cbbffad6d2046dda8916c784805bee13f2
@@ -964,6 +964,7 @@ msn_send_im(PurpleConnection *gc, const 
 		friendname = msn_encode_mime(account->username);
 		msn_oim_prep_send_msg_info(oim, purple_account_get_username(account),
 								   friendname, who,	message);
+		g_free(friendname);
 		msn_oim_send_msg(oim);
 	}
 
============================================================
--- libpurple/protocols/msn/msnutils.c	00634c8ed409c688a0282e4d99d1a69a232e260e
+++ libpurple/protocols/msn/msnutils.c	10b96dd4da6fa65290b4ca3dcf04d4b8aed6c6fd
@@ -166,10 +166,15 @@ msn_encode_mime(const char *str)
 char *
 msn_encode_mime(const char *str)
 {
-	char *base64;
+	gchar *base64, *retval;
+
+	g_return_val_if_fail(str != NULL, NULL);
 	
 	base64 = purple_base64_encode((guchar *)str, strlen(str));
-	return g_strdup_printf("=?utf-8?B?%s?=", base64);
+	retval = g_strdup_printf("=?utf-8?B?%s?=", base64);
+	g_free(base64);
+
+	return retval;
 }
 
 /*
============================================================
--- libpurple/protocols/msn/slp.c	e3a7309867f5389550094728532eaa61dd1ee6f8
+++ libpurple/protocols/msn/slp.c	9788bb47d805a16af5afecacc52be74af1c37bb9
@@ -505,6 +505,9 @@ got_invite(MsnSlpCall *slpcall,
 		int port;
 
 		nonce = get_token(content, "Nonce: {", "}\r\n");
+		if (ip_addrs == NULL)
+			return;
+
 		ip_addrs = get_token(content, "IPv4Internal-Addrs: ", "\r\n");
 
 		temp = get_token(content, "IPv4Internal-Port: ", "\r\n");
@@ -514,9 +517,6 @@ got_invite(MsnSlpCall *slpcall,
 			port = -1;
 		g_free(temp);
 
-		if (ip_addrs == NULL)
-			return;
-
 		if (port > 0)
 			got_transresp(slpcall, nonce, ip_addrs, port);
 
@@ -598,6 +598,9 @@ got_ok(MsnSlpCall *slpcall,
 		int port;
 
 		nonce = get_token(content, "Nonce: {", "}\r\n");
+		if (ip_addrs == NULL)
+			return;
+
 		ip_addrs = get_token(content, "IPv4Internal-Addrs: ", "\r\n");
 
 		temp = get_token(content, "IPv4Internal-Port: ", "\r\n");
@@ -607,9 +610,6 @@ got_ok(MsnSlpCall *slpcall,
 			port = -1;
 		g_free(temp);
 
-		if (ip_addrs == NULL)
-			return;
-
 		if (port > 0)
 			got_transresp(slpcall, nonce, ip_addrs, port);
 


More information about the Commits mailing list