Remove a bug where host_ip was accessed after freeing it.

Wed, 15 Apr 2009 15:46:31 +0000

author
Sulabh Mahajan <sulabh@pidgin.im>
date
Wed, 15 Apr 2009 15:46:31 +0000
changeset 26799
cce88cc18d12
parent 26798
0da78f253fd8
child 26800
64b40880e1ea
child 26922
022073ca48f4

Remove a bug where host_ip was accessed after freeing it.
This should prevent yahoo prpl crashes. I wonder how such a simple mistake escaped me for so long.

libpurple/protocols/yahoo/yahoo.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/yahoo/yahoo.c	Wed Apr 15 01:44:17 2009 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Wed Apr 15 15:46:31 2009 +0000
@@ -2973,8 +2973,10 @@
 
 		/* connect to host */
 		if((purple_proxy_connect(NULL, account, host_ip, YAHOO_PAGER_PORT_P2P, yahoo_p2p_init_cb, p2p_data))==NULL)	{
-			yahoo_p2p_disconnect_destroy_data(p2p_data);
 			purple_debug_info("yahoo","p2p: Connection to %s failed\n", host_ip);
+			g_free(p2p_data->host_ip);
+			g_free(p2p_data->host_username);
+			g_free(p2p_data);
 		}
 	}
 }

mercurial