summaryrefslogtreecommitdiff
path: root/ext/fileinfo/libmagic/apprentice.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2014-04-10 16:49:13 +0300
committerAndrey Hristov <andrey@php.net>2014-04-10 16:49:13 +0300
commit090c3e87c0449e6eadf83815bb57c8a6eff4b56e (patch)
tree946fdc55ed17d2dc07a99b388565cc96197026dd /ext/fileinfo/libmagic/apprentice.c
parent63791d055ad64762c3f63e08ca7ad8ba1f44e0ab (diff)
parent3204ad5858a5abc50b11b8527d22c82eb07a80cc (diff)
downloadphp-git-090c3e87c0449e6eadf83815bb57c8a6eff4b56e.tar.gz
Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6
Conflicts: ext/mysqli/tests/mysqli_begin_transaction.phpt
Diffstat (limited to 'ext/fileinfo/libmagic/apprentice.c')
-rw-r--r--ext/fileinfo/libmagic/apprentice.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c
index 4196e17afa..ce747378aa 100644
--- a/ext/fileinfo/libmagic/apprentice.c
+++ b/ext/fileinfo/libmagic/apprentice.c
@@ -499,12 +499,14 @@ apprentice_unmap(struct magic_map *map)
if (map == NULL)
return;
if (map->p != php_magic_database) {
- int j;
- for (j = 0; j < MAGIC_SETS; j++) {
- if (map->magic[j])
- efree(map->magic[j]);
- }
- if (map->p != NULL) {
+ if (map->p == NULL) {
+ int j;
+ for (j = 0; j < MAGIC_SETS; j++) {
+ if (map->magic[j]) {
+ efree(map->magic[j]);
+ }
+ }
+ } else {
efree(map->p);
}
}