[libxml2] Fix leak in __xmlOutputBufferCreateFilename



commit d7f11fd06642dde05baacda849a377175970e52c
Author: David King <amigadave amigadave com>
Date:   Wed Jul 14 17:03:46 2021 +0100

    Fix leak in __xmlOutputBufferCreateFilename
    
    Found by Coverity.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1938806

 xmlIO.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/xmlIO.c b/xmlIO.c
index f20c0fa0..007144c7 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -2735,6 +2735,8 @@ __xmlOutputBufferCreateFilename(const char *URI,
                    ret->writecallback = xmlGzfileWrite;
                    ret->closecallback = xmlGzfileClose;
                }
+               else
+                   xmlGzfileClose(context);
                return(ret);
            }
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]