changeset 16239:55a5791838f7

When reading in substatuses from status.xml, ignore substatuses for which we can't determine the PurpleStatusType. This fixes a crash for me when switching from away to available. I'm not sure what the exact repro case is, but it definitely happens.
author Mark Doliner <mark@kingant.net>
date Wed, 18 Apr 2007 07:42:23 +0000
parents 67627b73e106
children 547c76fe2e7a 502b69976fe1
files libpurple/savedstatuses.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/savedstatuses.c	Wed Apr 18 07:18:12 2007 +0000
+++ b/libpurple/savedstatuses.c	Wed Apr 18 07:42:23 2007 +0000
@@ -403,6 +403,12 @@
 		g_free(data);
 	}
 
+	if (ret->type == NULL)
+	{
+		g_free(ret);
+		return NULL;
+	}
+
 	/* Read the message */
 	node = xmlnode_get_child(substatus, "message");
 	if ((node != NULL) && ((data = xmlnode_get_data(node)) != NULL))