allocation error #119784 raised by Oliver Stoeneberg Daniel

* HTMLparser.c: allocation error #119784 raised by Oliver Stoeneberg
Daniel
diff --git a/HTMLparser.c b/HTMLparser.c
index 8f9cfff..28617fe 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -4273,7 +4273,7 @@
 
 	if (ctxt->input->encoding != NULL)
 	    xmlFree((xmlChar *) ctxt->input->encoding);
-	ctxt->input->encoding = (const xmlChar *) encoding;
+	ctxt->input->encoding = xmlStrdup((const xmlChar *) encoding);
 
 	enc = xmlParseCharEncoding(encoding);
 	/*
@@ -4285,7 +4285,6 @@
 		if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
 		    ctxt->sax->error(ctxt->userData,
 			 "Unsupported encoding %s\n", encoding);
-		ctxt->input->encoding = NULL;
 	    }
 	} else {
 	    /*