[libxml2] Fix memory leak in xmlAllocOutputBufferInternal error path



commit f824a4bd4d341d765a0fb6102a03a733faa15cbb
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Mon May 20 13:26:08 2019 +0200

    Fix memory leak in xmlAllocOutputBufferInternal error path
    
    Thanks to Anish K Kurian for the report. Closes #60.

 xmlIO.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/xmlIO.c b/xmlIO.c
index a0b45322..299b6d21 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -2435,6 +2435,7 @@ xmlAllocOutputBufferInternal(xmlCharEncodingHandlerPtr encoder) {
     if (encoder != NULL) {
         ret->conv = xmlBufCreateSize(4000);
        if (ret->conv == NULL) {
+            xmlBufFree(ret->buffer);
            xmlFree(ret);
            return(NULL);
        }


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