changeset 26151:68f14660843e

correct a malloc bug
author Sulabh Mahajan <sulabh@soc.pidgin.im>
date Sun, 28 Sep 2008 15:52:08 +0000
parents 47a1a94b479b
children bb5a6709d9b7
files libpurple/protocols/yahoo/yahoo.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo.c	Sat Sep 27 15:36:16 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Sun Sep 28 15:52:08 2008 +0000
@@ -2822,8 +2822,7 @@
 				val_11 = f->session_id;
 		}
 
-		p2p_data->host_username = (char *)g_malloc(strlen(who));
-		strcpy(p2p_data->host_username, who);		
+		p2p_data->host_username = g_strdup(who);
 		p2p_data->val_13 = val_13;
 		p2p_data->session_id = val_11;
 		p2p_data->host_ip = host_ip;