From 0b3b2ff8839c2d00c24c466a3789eb29d12ba20b Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Thu, 20 Jan 2022 04:41:47 +0100 Subject: xmlwf: Fix a memory leak on output file opening error --- expat/Changes | 9 +++++++++ expat/xmlwf/xmlwf.c | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/expat/Changes b/expat/Changes index 7540d38c..30f1cf7c 100644 --- a/expat/Changes +++ b/expat/Changes @@ -2,6 +2,15 @@ NOTE: We are looking for help with a few things: https://github.com/libexpat/libexpat/labels/help%20wanted If you can help, please get in touch. Thanks! +Release x.x.x xxx xxxxxxx xx xxxx + Bug fixes: + #544 #545 xmlwf: Fix a memory leak on output file opening error + + Special thanks to: + hwt0415 + and + Clang LeakSan and the Clang team + Release 2.4.3 Sun January 16 2022 Security fixes: #531 #534 CVE-2021-45960 -- Fix issues with left shifts by >=29 places diff --git a/expat/xmlwf/xmlwf.c b/expat/xmlwf/xmlwf.c index 29118bb6..b6f300b0 100644 --- a/expat/xmlwf/xmlwf.c +++ b/expat/xmlwf/xmlwf.c @@ -1175,9 +1175,9 @@ tmain(int argc, XML_Char **argv) { if (! userData.fp) { tperror(outName); exitCode = XMLWF_EXIT_OUTPUT_ERROR; + free(outName); + XML_ParserFree(parser); if (continueOnError) { - free(outName); - cleanupUserData(&userData); continue; } else { break; -- cgit v1.2.1