diff libpurple/protocols/myspace/message.c @ 19256:34a1957de14b

Fix crashes. In myspace.c, clone the contact_info message before sending it to the callback function, and free it there. Also add a check to message.c to catch null element names, to somewhat prevent this mistake in the future.
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Mon, 20 Aug 2007 02:35:32 +0000
parents 1ea47b06f1a6
children 3b7539c7402e
line wrap: on
line diff
--- a/libpurple/protocols/myspace/message.c	Mon Aug 20 01:15:00 2007 +0000
+++ b/libpurple/protocols/myspace/message.c	Mon Aug 20 02:35:32 2007 +0000
@@ -1010,8 +1010,10 @@
 	for (node = msg; node != NULL; node = g_list_next(node)) {
 		MsimMessageElement *elem;
 
-		elem = node->data;
+		elem = (MsimMessageElement *)node->data;
+
 		g_return_val_if_fail(elem != NULL, NULL);
+		g_return_val_if_fail(elem->name != NULL, NULL);
 
 		if (strcmp(elem->name, name) == 0) {
 			return node;