r5369 jmb - /trunk/netsurf/render/html.c

netsurf at semichrome.net netsurf at semichrome.net
Thu Sep 18 10:56:28 BST 2008


Author: jmb
Date: Thu Sep 18 04:56:28 2008
New Revision: 5369

URL: http://source.netsurf-browser.org?rev=5369&view=rev
Log:
Stop double-freeing the document in some error cases.

Modified:
    trunk/netsurf/render/html.c

Modified: trunk/netsurf/render/html.c
URL: http://source.netsurf-browser.org/trunk/netsurf/render/html.c?rev=5369&r1=5368&r2=5369&view=diff
==============================================================================
--- trunk/netsurf/render/html.c (original)
+++ trunk/netsurf/render/html.c Thu Sep 18 04:56:28 2008
@@ -701,6 +701,7 @@
 	hubbub_parser_destroy(c->data.html.parser);
 	if (c->data.html.document) {
 		xmlFreeDoc(c->data.html.document);
+		c->data.html.document = NULL;
 	}
 	c->data.html.has_ns = false;
 	memset(c->data.html.ns, 0, sizeof(c->data.html.ns));
@@ -908,7 +909,6 @@
 	html = xmlDocGetRootElement(c->data.html.document);
 	if (html == 0 || strcmp((const char *) html->name, "html") != 0) {
 		LOG(("html element not found"));
-		xmlFreeDoc(c->data.html.document);
 		msg_data.error = messages_get("ParsingFail");
 		content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
 		return false;




More information about the netsurf-commits mailing list