[libxml2] runtest: Fix a memory leak on parse failure



commit 5777ae75ee0382149971a5bc2094f9d14e7e11f8
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Fri Jun 20 21:15:16 2014 +0100

    runtest: Fix a memory leak on parse failure
    
    Coverity issue: #60439
    
    https://bugzilla.gnome.org/show_bug.cgi?id=731990

 runtest.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/runtest.c b/runtest.c
index ccdd49b..02fe09a 100644
--- a/runtest.c
+++ b/runtest.c
@@ -1679,7 +1679,8 @@ saxParseTest(const char *filename, const char *result,
     }
     if (ret != 0) {
         fprintf(stderr, "Failed to parse %s\n", filename);
-       return(1);
+       ret = 1;
+       goto done;
     }
 #ifdef LIBXML_HTML_ENABLED
     if (options & XML_PARSE_HTML) {
@@ -1701,6 +1702,8 @@ saxParseTest(const char *filename, const char *result,
         fprintf(stderr, "Got a difference for %s\n", filename);
         ret = 1;
     }
+
+done:
     if (temp != NULL) {
         unlink(temp);
         free(temp);


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