From: Anatol Belski Date: Mon, 8 Apr 2013 10:49:53 +0000 (+0200) Subject: fix memory leak at apprentice.c:1095 X-Git-Tag: php-5.4.15RC1~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28e26b0fad184e337e4494da541bb5c1e8987291;p=php fix memory leak at apprentice.c:1095 --- diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c index 8c729d13b9..06d28ad5c7 100644 --- a/ext/fileinfo/libmagic/apprentice.c +++ b/ext/fileinfo/libmagic/apprentice.c @@ -495,6 +495,13 @@ apprentice_unmap(struct magic_map *map) if (map->p != NULL && map->p != php_magic_database) { efree(map->p); } + if (map->p != php_magic_database) { + int j; + for (j = 0; j < MAGIC_SETS; j++) { + if (map->magic[j]) + efree(map->magic[j]); + } + } efree(map); }