[libxml2] Fix memory leak in xmlNewInputFromFile
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Fix memory leak in xmlNewInputFromFile
- Date: Sun, 16 Jan 2022 15:02:04 +0000 (UTC)
commit 328456bf29b32897bcfcc13f106ec4f975ac5d8a
Author: David King <amigadave amigadave com>
Date: Wed Jul 14 14:43:59 2021 +0100
Fix memory leak in xmlNewInputFromFile
Found by Coverity.
https://bugzilla.redhat.com/show_bug.cgi?id=1938806
parserInternals.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/parserInternals.c b/parserInternals.c
index cbcfde0e..c5c0b16d 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -1546,8 +1546,10 @@ xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) {
}
inputStream = xmlNewInputStream(ctxt);
- if (inputStream == NULL)
+ if (inputStream == NULL) {
+ xmlFreeParserInputBuffer(buf);
return(NULL);
+ }
inputStream->buf = buf;
inputStream = xmlCheckHTTPInput(ctxt, inputStream);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]