changeset 20218:99ceb1329a5b

applied changes from 3fcc47961d378fa0cd4eeb00dc6923b16a3a4151 through c9d6104bcfe2e630e98e45bc6a0975adfb9544e5
author Richard Laager <rlaager@wiktel.com>
date Fri, 28 Sep 2007 15:45:25 +0000
parents d4e250c3cd44
children d68db74b7165
files libpurple/protocols/jabber/google.c libpurple/util.c
diffstat 2 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/google.c	Fri Sep 28 15:45:06 2007 +0000
+++ b/libpurple/protocols/jabber/google.c	Fri Sep 28 15:45:25 2007 +0000
@@ -61,14 +61,9 @@
 	to = xmlnode_get_attrib(packet, "to");
 	default_tos[0] = jabber_get_bare_jid(to);
 
-	if (count == 0) {
-		purple_notify_emails(js->gc, count, FALSE, NULL, NULL, (const char**) default_tos, NULL, NULL, NULL);
-		g_free(default_tos[0]);
-		return;
-	}
+	message = xmlnode_get_child(child, "mail-thread-info");
 
-	message = xmlnode_get_child(child, "mail-thread-info");
-	if (!message) {
+	if (count == 0 || !message) {
 		purple_notify_emails(js->gc, count, FALSE, NULL, NULL, (const char**) default_tos, NULL, NULL, NULL);
 		g_free(default_tos[0]);
 		return;
@@ -127,7 +122,7 @@
 	if (i>0)
 		purple_notify_emails(js->gc, count, count == i, (const char**) subjects, froms, tos,
 				urls, NULL, NULL);
-	else 
+	else
 		purple_notify_emails(js->gc, count, FALSE, NULL, NULL, (const char**) default_tos, NULL, NULL, NULL);
 
 
@@ -257,7 +252,8 @@
 
 	if (grt && (*grt == 'H' || *grt == 'h')) {
 		PurpleBuddy *buddy = purple_find_buddy(account, jid_norm);
-		purple_blist_remove_buddy(buddy);
+		if (buddy)
+			purple_blist_remove_buddy(buddy);
 		g_free(jid_norm);
 		return FALSE;
 	}
--- a/libpurple/util.c	Fri Sep 28 15:45:06 2007 +0000
+++ b/libpurple/util.c	Fri Sep 28 15:45:25 2007 +0000
@@ -1542,7 +1542,8 @@
 					while(*p && *p != '>') {
 						if(!g_ascii_strncasecmp(p, "href=", strlen("href="))) {
 							const char *q = p + strlen("href=");
-							g_string_free(url, TRUE);
+							if (url)
+								g_string_free(url, TRUE);
 							url = g_string_new("");
 							cdata = g_string_new("");
 							if(*q == '\'' || *q == '\"')