diff options
Diffstat (limited to 'ext/mime_magic/mime_magic.c')
-rw-r--r-- | ext/mime_magic/mime_magic.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/mime_magic/mime_magic.c b/ext/mime_magic/mime_magic.c index 89138d8764..f37eb4726c 100644 --- a/ext/mime_magic/mime_magic.c +++ b/ext/mime_magic/mime_magic.c @@ -274,6 +274,14 @@ PHP_MINIT_FUNCTION(mime_magic) PHP_MSHUTDOWN_FUNCTION(mime_magic) { UNREGISTER_INI_ENTRIES(); + if (mime_global.magic != NULL && (int)mime_global.magic != -1) { + struct magic *iter = mime_global.magic; + while (iter != NULL) { + struct magic *iter_next = iter->next; + free(iter); + iter = iter_next; + } + } return SUCCESS; } /* }}} */ |