]> granicus.if.org Git - php/commitdiff
- Kill a couple of double frees and a memleak
authorSteph Fox <sfox@php.net>
Sat, 21 Jun 2008 20:47:35 +0000 (20:47 +0000)
committerSteph Fox <sfox@php.net>
Sat, 21 Jun 2008 20:47:35 +0000 (20:47 +0000)
@Greg: You may want to run valgrind over the filestat functions before release..

ext/phar/func_interceptors.c

index 026f88fd5d81efd0f517b636a60bff0899967804..81d3ec710b60d0fcf3760f385485a1397f8443d9 100644 (file)
@@ -685,6 +685,7 @@ notfound:
                                        efree(entry);
                                        efree(save2);
                                        if (IS_EXISTS_CHECK(type)) {
+                                               efree(arch);
                                                RETURN_TRUE;
                                        }
                                        goto stat_entry;
@@ -724,6 +725,7 @@ notfound:
                                RETURN_FALSE;
                        }
 stat_entry:
+                       efree(arch);
                        if (!data->is_dir) {
                                sb.st_size = data->uncompressed_filesize;
                                sb.st_mode = data->flags & PHAR_ENT_PERM_MASK;
@@ -762,7 +764,6 @@ stat_entry:
                        }
 
 statme_baby:
-                       efree(arch);
                        if (!phar->is_writeable) {
                                sb.st_mode = (sb.st_mode & 0555) | (sb.st_mode & ~0777);
                        }