Mercurial > pidgin
comparison libpurple/protocols/jabber/parser.c @ 24480:7cf760f3560e
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 Knig in
http://pidgin.im/pipermail/devel/2008-November/007035.html and the following
messages.
author | Will Thompson <will.thompson@collabora.co.uk> |
---|---|
date | Fri, 21 Nov 2008 12:12:31 +0000 |
parents | 8de8ca65e1d9 |
children | f5c0cdaef99a |
comparison
equal
deleted
inserted
replaced
24478:88955b918197 | 24480:7cf760f3560e |
---|---|
112 js->current = js->current->parent; | 112 js->current = js->current->parent; |
113 } else { | 113 } else { |
114 xmlnode *packet = js->current; | 114 xmlnode *packet = js->current; |
115 js->current = NULL; | 115 js->current = NULL; |
116 jabber_process_packet(js, &packet); | 116 jabber_process_packet(js, &packet); |
117 xmlnode_free(packet); | 117 if (packet != NULL) |
118 xmlnode_free(packet); | |
118 } | 119 } |
119 } | 120 } |
120 | 121 |
121 static void | 122 static void |
122 jabber_parser_element_text_libxml(void *user_data, const xmlChar *text, int text_len) | 123 jabber_parser_element_text_libxml(void *user_data, const xmlChar *text, int text_len) |