mirror of
https://github.com/darlinghq/darling-libxml2.git
synced 2025-03-03 16:55:55 +00:00
Fix an fd leak in an error case
This commit is contained in:
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user