Fix an fd leak in an error case
diff --git a/catalog.c b/catalog.c
index 549e592..5773db3 100644
--- a/catalog.c
+++ b/catalog.c
@@ -994,6 +994,11 @@
     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