summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2022-01-20 04:41:47 +0100
committerSebastian Pipping <sebastian@pipping.org>2022-01-24 15:41:32 +0100
commit85a6f8fcdb2bc1530934f8cf684bdab86f1f2a1c (patch)
tree7e2a0a92d2a4b78df446d18c9c5c3bf1f85a9c91
parent178d26f50af21ec23d6e43814b9b602590b5865c (diff)
downloadexpat-85a6f8fcdb2bc1530934f8cf684bdab86f1f2a1c.tar.gz
xmlwf: Fix a memory leak on output file opening error
-rw-r--r--expat/Changes6
-rw-r--r--expat/xmlwf/xmlwf.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/expat/Changes b/expat/Changes
index 64d75d05..5ff5da5e 100644
--- a/expat/Changes
+++ b/expat/Changes
@@ -11,8 +11,14 @@ Release x.x.x xxx xxxxxxx xx xxxx
common and default).
Impact is denial of service or more.
+ Bug fixes:
+ #544 #545 xmlwf: Fix a memory leak on output file opening error
+
Special thanks to:
+ hwt0415
Samanta Navarro
+ and
+ Clang LeakSan and the Clang team
Release 2.4.3 Sun January 16 2022
Security fixes:
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;