summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMoriyoshi Koizumi <moriyoshi@php.net>2002-11-18 21:15:41 +0000
committerMoriyoshi Koizumi <moriyoshi@php.net>2002-11-18 21:15:41 +0000
commita9d750903643f157df28ab115ef4a09a8481d037 (patch)
tree9aa74ec8a175e0daafd606cb656a7fe5f22094c5 /ext
parent0ad980c667d08f2a34a2eb6eb6cfddecf02b370c (diff)
downloadphp-git-a9d750903643f157df28ab115ef4a09a8481d037.tar.gz
Fixed possible leaks
Diffstat (limited to 'ext')
-rw-r--r--ext/mime_magic/mime_magic.c8
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;
}
/* }}} */