diff libpurple/protocols/myspace/myspace.c @ 24770:22fd7467f0cc

Fix a few small memleaks
author Mark Doliner <mark@kingant.net>
date Thu, 18 Dec 2008 01:53:49 +0000
parents 759dbafdc74a
children c6cadb7bdcf7 401f548e3544 4e8748f3374f
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.c	Wed Dec 17 22:37:53 2008 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Thu Dec 18 01:53:49 2008 +0000
@@ -1380,17 +1380,15 @@
 	if (status_headline && strcmp(status_headline, "") != 0) {
 		/* The status headline is plaintext, but libpurple treats it as HTML,
 		 * so escape any HTML characters to their entity equivalents. */
-		status_headline_escaped = g_markup_escape_text(status_headline, strlen(status_headline));
+		status_headline_escaped = g_markup_escape_text(status_headline, -1);
 	} else {
 		status_headline_escaped = NULL;
 	}
 
 	g_free(status_headline);
 
-	if (user->headline)
-		g_free(user->headline);
-
 	/* don't copy; let the MsimUser own the headline, memory-wise */
+	g_free(user->headline);
 	user->headline = status_headline_escaped;
 
 	/* Set user status */
@@ -1421,7 +1419,6 @@
 					status_code);
 			msim_unrecognized(session, NULL, unrecognized_msg);
 			g_free(unrecognized_msg);
-
 	}
 
 	purple_prpl_got_user_status(session->account, username, purple_primitive_get_id_from_type(purple_status_code), NULL);