diff options
author | Anatol Belski <ab@php.net> | 2013-04-08 12:49:53 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2013-04-08 12:49:53 +0200 |
commit | 28e26b0fad184e337e4494da541bb5c1e8987291 (patch) | |
tree | d76c6058f9d15b88ee55f7e34ce62332f443fd53 /ext/fileinfo/libmagic | |
parent | b0b81c0a37b33ee6b302c828831a2d1488994cb5 (diff) | |
download | php-git-28e26b0fad184e337e4494da541bb5c1e8987291.tar.gz |
fix memory leak at apprentice.c:1095
Diffstat (limited to 'ext/fileinfo/libmagic')
-rw-r--r-- | ext/fileinfo/libmagic/apprentice.c | 7 |
1 files changed, 7 insertions, 0 deletions
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); } |