summaryrefslogtreecommitdiff
path: root/catalog.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2014-02-06 10:38:00 +0100
committerDaniel Veillard <veillard@redhat.com>2014-02-06 10:38:00 +0100
commit15d12040ff48c5190addd315092c9262fbe54e91 (patch)
treeb21e628d9c577794fa49c04430d0d2e9607a3e02 /catalog.c
parent054c716ea1bf001544127a4ab4f4346d1b9947e7 (diff)
downloadlibxml2-15d12040ff48c5190addd315092c9262fbe54e91.tar.gz
Fix an fd leak in an error case
Diffstat (limited to 'catalog.c')
-rw-r--r--catalog.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/catalog.c b/catalog.c
index 549e592b..5773db3d 100644
--- a/catalog.c
+++ b/catalog.c
@@ -994,6 +994,11 @@ xmlLoadFileContent(const char *filename)
content = (xmlChar*)xmlMallocAtomic(size + 10);
if (content == NULL) {
xmlCatalogErrMemory("allocating catalog data");
+#ifdef HAVE_STAT
+ close(fd);
+#else
+ fclose(fd);
+#endif
return (NULL);
}
#ifdef HAVE_STAT