summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/fileinfo/libmagic/apprentice.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c
index 06d28ad5c7..0620fc7f93 100644
--- a/ext/fileinfo/libmagic/apprentice.c
+++ b/ext/fileinfo/libmagic/apprentice.c
@@ -492,15 +492,15 @@ apprentice_unmap(struct magic_map *map)
{
if (map == NULL)
return;
- 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]);
}
+ if (map->p != NULL) {
+ efree(map->p);
+ }
}
efree(map);
}