summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2014-06-20 21:15:16 +0100
committerDaniel Veillard <veillard@redhat.com>2014-07-26 20:16:33 +0800
commit5777ae75ee0382149971a5bc2094f9d14e7e11f8 (patch)
tree41de3e646ff4c9eea389f936ada45fe12b7ba1df
parent31aa38158a0ec6075749838639775f3c01e01f6c (diff)
downloadlibxml2-5777ae75ee0382149971a5bc2094f9d14e7e11f8.tar.gz
runtest: Fix a memory leak on parse failure
Coverity issue: #60439 https://bugzilla.gnome.org/show_bug.cgi?id=731990
-rw-r--r--runtest.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtest.c b/runtest.c
index ccdd49b4..02fe09a6 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);