From 581a4c7ccfb5b06b4df41ab2eeae926f45449e0f Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Tue, 25 Apr 2017 18:46:51 +0100 Subject: [PATCH] Validate parser parameter to XML_MemFree --- expat/lib/xmlparse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 95e48fc1..7c91d87a 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -2106,7 +2106,8 @@ XML_MemRealloc(XML_Parser parser, void *ptr, size_t size) void XMLCALL XML_MemFree(XML_Parser parser, void *ptr) { - FREE(ptr); + if (parser != NULL) + FREE(ptr); } void XMLCALL