Fix an fd leak in an error case

This commit is contained in:
Daniel Veillard 2014-02-06 10:38:00 +01:00
parent 054c716ea1
commit 15d12040ff

@ -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