]> granicus.if.org Git - php/commitdiff
Fix memory leak in touch when safety check fails
authorStanislav Malyshev <stas@php.net>
Thu, 27 Jul 2000 13:28:21 +0000 (13:28 +0000)
committerStanislav Malyshev <stas@php.net>
Thu, 27 Jul 2000 13:28:21 +0000 (13:28 +0000)
ext/standard/filestat.c

index a82a05ed3fc31925ad23ab703fee2b719ee7bbea..2de03fb9a7e2c4cb630bfb3d74836200973ab387 100644 (file)
@@ -402,8 +402,10 @@ PHP_FUNCTION(touch)
        }
 
        /* Check the basedir */
-       if (php_check_open_basedir((*filename)->value.str.val))
+       if (php_check_open_basedir((*filename)->value.str.val)) {
+               if (newtime) efree(newtime);
                RETURN_FALSE;
+       }
 
        /* create the file if it doesn't exist already */
        ret = V_STAT((*filename)->value.str.val, &sb);