From 0fda4f509be96659000e79f7c38ec5d1ac3c336f Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 18 Sep 2008 09:56:28 +0000 Subject: Stop double-freeing the document in some error cases. svn path=/trunk/netsurf/; revision=5369 --- render/html.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/render/html.c b/render/html.c index 3e7779917..7f9eaf44f 100644 --- a/render/html.c +++ b/render/html.c @@ -701,6 +701,7 @@ encoding_change: 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 @@ bool html_convert(struct content *c, int width, int height) 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; -- cgit v1.2.3