diff -r 7fa31956a26b -r 90ae53934c28 libpurple/protocols/myspace/markup.c
--- a/libpurple/protocols/myspace/markup.c Fri Oct 19 16:58:37 2007 +0000
+++ b/libpurple/protocols/myspace/markup.c Fri Oct 19 17:06:53 2007 +0000
@@ -444,7 +444,8 @@
*begin = g_strdup_printf("", MSIM_TEXT_UNDERLINE);
*end = g_strdup("");
} else if (!purple_utf8_strcasecmp(root->name, "a")) {
- const gchar *href, *link_text;
+ const gchar *href;
+ gchar *link_text;
href = xmlnode_get_attrib(root, "href");
@@ -476,6 +477,7 @@
/* Sorry, kid. MySpace doesn't support you within tags. */
xmlnode_free(root->child);
+ g_free(link_text);
root->child = NULL;
*end = g_strdup("");
@@ -567,10 +569,7 @@
case XMLNODE_TYPE_DATA:
/* Literal text. */
- inner = g_new0(char, node->data_sz + 1);
- strncpy(inner, node->data, node->data_sz);
- inner[node->data_sz] = 0;
-
+ inner = g_strndup(node->data, node->data_sz);
purple_debug_info("msim", " ** node data=%s\n",
inner ? inner : "(NULL)");
break;
@@ -583,6 +582,8 @@
if (inner) {
g_string_append(final, inner);
+ g_free(inner);
+ inner = NULL;
}
}
@@ -592,6 +593,9 @@
* Comment out this line below to see. */
g_string_append(final, end);
+ g_free(begin);
+ g_free(end);
+
purple_debug_info("msim", "msim_markup_xmlnode_to_gtkhtml: RETURNING %s\n",
(final && final->str) ? final->str : "(NULL)");