From 28e26b0fad184e337e4494da541bb5c1e8987291 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 8 Apr 2013 12:49:53 +0200 Subject: [PATCH] fix memory leak at apprentice.c:1095 --- ext/fileinfo/libmagic/apprentice.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); } -- 2.50.0