pidgin: 3998d534: Don't try to free NULL xmlnodes stolen b...

resiak at pidgin.im resiak at pidgin.im
Fri Nov 21 07:25:51 EST 2008


-----------------------------------------------------------------
Revision: 3998d5347fcf57a8cc9b15a560ecac141d093cc5
Ancestor: c36cf6e54e25bff1ff7802082ae3c787d658187c
Author: resiak at pidgin.im
Date: 2008-11-21T12:12:31
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/3998d5347fcf57a8cc9b15a560ecac141d093cc5

Modified files:
        libpurple/protocols/jabber/parser.c

ChangeLog: 

Don't try to free NULL xmlnodes stolen by jabber-receiving-xmlnode handlers

Handlers get a (xmlnode **) that they're meant to set to NULL if they steal
the node for their own nefarious purposes, signalling to the prpl that it
should forget about that node.  But the prpl still tried to free the xmlnode*
even if it had been NULLified, triggering g_return_if_fail warnings.

Fixes the issue discussed by Arne K?nig in
http://pidgin.im/pipermail/devel/2008-November/007035.html and the following
messages.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/parser.c	4a7faa5e4f134700bd99b7971715b2fce71f48f8
+++ libpurple/protocols/jabber/parser.c	922b0b9447575fc37cbde99f86d110a6f0c94b88
@@ -114,7 +114,8 @@ jabber_parser_element_end_libxml(void *u
 		xmlnode *packet = js->current;
 		js->current = NULL;
 		jabber_process_packet(js, &packet);
-		xmlnode_free(packet);
+		if (packet != NULL)
+			xmlnode_free(packet);
 	}
 }
 


More information about the Commits mailing list