Merge pull request #545 from libexpat/issue-544-fix-xmlwf-memleak-on-file-opening-error

[>=2.3.0] xmlwf: Fix a memory leak on output file opening error (fixes #544)
This commit is contained in:
Sebastian Pipping 2022-01-24 18:45:26 +01:00 committed by GitHub
commit 5f100ffa78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -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:

View file

@ -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;