Commit:    28e26b0fad184e337e4494da541bb5c1e8987291
Author:    Anatol Belski <a...@php.net>         Mon, 8 Apr 2013 12:49:53 +0200
Parents:   b0b81c0a37b33ee6b302c828831a2d1488994cb5
Branches:  PHP-5.4 PHP-5.5 master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=28e26b0fad184e337e4494da541bb5c1e8987291

Log:
fix memory leak at apprentice.c:1095

Changed paths:
  M  ext/fileinfo/libmagic/apprentice.c


Diff:
diff --git a/ext/fileinfo/libmagic/apprentice.c 
b/ext/fileinfo/libmagic/apprentice.c
index 8c729d1..06d28ad 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);
 }


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to