[libxml2] Fix an fd leak in an error case



commit 15d12040ff48c5190addd315092c9262fbe54e91
Author: Daniel Veillard <veillard redhat com>
Date:   Thu Feb 6 10:38:00 2014 +0100

    Fix an fd leak in an error case

 catalog.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/catalog.c b/catalog.c
index 549e592..5773db3 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


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