changeset 22135:3550c5d7c493

Plug a leak.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Thu, 17 Jan 2008 06:17:02 +0000
parents 33abfb98a460
children 9df0a8c7c9b7
files libpurple/protocols/yahoo/yahoo_aliases.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo_aliases.c	Thu Jan 17 06:11:57 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo_aliases.c	Thu Jan 17 06:17:02 2008 +0000
@@ -227,11 +227,11 @@
 	struct yahoo_data *yd;
 	struct YahooUser *yu;
 	char *content, *url, *request, *webpage, *webaddress, *strtmp;
+	char *escaped_alias, *alias_jp, *converted_alias_jp;
 	int inttmp;
 	struct callback_data *cb;
 	PurpleBuddy *buddy;
 	PurpleUtilFetchUrlData *url_data;
-	char *alias_jp, *converted_alias_jp;
 
 	g_return_if_fail(alias != NULL);
 	g_return_if_fail(who != NULL);
@@ -267,9 +267,11 @@
 		g_free(alias_jp);
 	}
 	else {
+		escaped_alias = g_markup_escape_text(alias, strlen(alias));
 		content = g_strdup_printf("<?xml version=\"1.0\" encoding=\"utf-8\"?><ab k=\"%s\" cc=\"1\">\n"
 		                          "<ct e=\"1\"  yi='%s' id='%s' nn='%s' pr='0' />\n</ab>\r\n",
-		                          gc->account->username, who, yu->id, g_markup_escape_text(alias, strlen(alias)));
+		                          gc->account->username, who, yu->id, escaped_alias);
+		g_free(escaped_alias);
 	}
 
 	request = g_strdup_printf("POST /%s HTTP/1.1\r\n"