# HG changeset patch # User Andreas Monitzer # Date 1181941762 0 # Node ID af833a3204bbafe75011c70d05b7820bcbcaee8b # Parent 460b4bf797e7e6bcdf0f2237a28e53462fae8bd9 Fixed usermood memory management and removed publishing empty s. diff -r 460b4bf797e7 -r af833a3204bb libpurple/protocols/jabber/usermood.c --- a/libpurple/protocols/jabber/usermood.c Fri Jun 15 11:00:46 2007 +0000 +++ b/libpurple/protocols/jabber/usermood.c Fri Jun 15 21:09:22 2007 +0000 @@ -94,7 +94,7 @@ static void jabber_mood_cb(JabberStream *js, const char *from, xmlnode *items) { /* it doesn't make sense to have more than one item here, so let's just pick the first one */ xmlnode *item = xmlnode_get_child(items, "item"); - char *newmood; + const char *newmood; char *moodtext = NULL; JabberBuddy *buddy = jabber_buddy_find(js, from, FALSE); xmlnode *moodinfo, *mood; @@ -202,12 +202,12 @@ xmlnode_set_namespace(moodnode, "http://jabber.org/protocol/mood"); xmlnode_new_child(moodnode, mood); - if (text) { + if (text && text[0] != '\0') { xmlnode *textnode = xmlnode_new_child(moodnode, "text"); xmlnode_insert_data(textnode, text, -1); } jabber_pep_publish(js, publish); - - xmlnode_free(publish); + /* publish is freed by jabber_pep_publish -> jabber_iq_send -> jabber_iq_free + (yay for well-defined memory management rules) */ }