/pidgin/main: 5568b251e0d9: Fix double-free caused by the remova...

Michael McConville mmcconville at mykolab.com
Sun Jul 26 21:15:07 EDT 2015


Changeset: 5568b251e0d91954c33a2cf7928189b9567a33fd
Author:	 Michael McConville <mmcconville at mykolab.com>
Date:	 2015-07-26 21:11 -0400
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/5568b251e0d9

Description:

Fix double-free caused by the removal of a copy of the 'from' address (related to federation removal)

diffstat:

 libpurple/protocols/yahoo/ymsg.c |  8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diffs (46 lines):

diff --git a/libpurple/protocols/yahoo/ymsg.c b/libpurple/protocols/yahoo/ymsg.c
--- a/libpurple/protocols/yahoo/ymsg.c
+++ b/libpurple/protocols/yahoo/ymsg.c
@@ -980,7 +980,6 @@ static void yahoo_process_message(Purple
 					purple_debug_warning("yahoo","p2p: %s sent us message with wrong session id. Disconnecting p2p connection to peer\n", im->from);
 					/* remove from p2p connection lists, also calls yahoo_p2p_disconnect_destroy_data */
 					g_hash_table_remove(yd->peers, im->from);
-					g_free(im->from);
 					g_free(im);
 					return; /* Not sure whether we should process remaining IMs in this packet */
 				}
@@ -999,7 +998,6 @@ static void yahoo_process_message(Purple
 						if (!purple_account_privacy_check(account, im->from)) {
 							purple_debug_info("yahoo", "Doodle request from %s dropped.\n",
 												im->from);
-							g_free(im->from);
 							g_free(im);
 							return;
 						}
@@ -1036,8 +1034,7 @@ static void yahoo_process_message(Purple
 		char *m, *m2;
 		im = l->data;
 
-		if (!im->from || !im->msg) {
-			g_free(im->from);
+		if (!im->msg) {
 			g_free(im);
 			continue;
 		}
@@ -1085,7 +1082,6 @@ static void yahoo_process_message(Purple
 			purple_protocol_got_attention(gc, username, YAHOO_BUZZ);
 			g_free(username);
 			g_free(m);
-			g_free(im->from);
 			g_free(im);
 			continue;
 		}
@@ -1095,8 +1091,6 @@ static void yahoo_process_message(Purple
 
 		purple_serv_got_im(gc, im->from, m2, 0, im->time);
 		g_free(m2);
-
-		g_free(im->from);
 		g_free(im);
 	}
 



More information about the Commits mailing list