changeset 26146:9c633c83caa6

Fix a bug, where malloc failed to allocate memory at times, replaced with g_strdup
author Sulabh Mahajan <sulabh@soc.pidgin.im>
date Fri, 22 Aug 2008 18:48:03 +0000
parents abf830f6cd43
children 4e378c8b5c49
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	Fri Aug 22 15:00:16 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Fri Aug 22 18:48:03 2008 +0000
@@ -2676,8 +2676,7 @@
 
 	p2p_data->gc = gc;
 	p2p_data->host_ip = NULL;
-	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->connection_type = YAHOO_P2P_WE_ARE_SERVER;