moriyoshi Mon Nov 18 16:15:42 2002 EDT Modified files: /php4/ext/mime_magic mime_magic.c Log: Fixed possible leaks Index: php4/ext/mime_magic/mime_magic.c diff -u php4/ext/mime_magic/mime_magic.c:1.16 php4/ext/mime_magic/mime_magic.c:1.17 --- php4/ext/mime_magic/mime_magic.c:1.16 Fri Nov 15 11:25:31 2002 +++ php4/ext/mime_magic/mime_magic.c Mon Nov 18 16:15:41 2002 @@ -15,7 +15,7 @@ | Author: Hartmut Holzgraefe <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ - $Id: mime_magic.c,v 1.16 2002/11/15 16:25:31 moriyoshi Exp $ + $Id: mime_magic.c,v 1.17 2002/11/18 21:15:41 moriyoshi Exp $ This module contains a lot of stuff taken from Apache mod_mime_magic, so the license section is a little bit longer than usual: @@ -274,6 +274,14 @@ 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; } /* }}} */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php