From: Stanislav Malyshev Date: Thu, 27 Jul 2000 13:28:21 +0000 (+0000) Subject: Fix memory leak in touch when safety check fails X-Git-Tag: PRE_FILE_COMPILE_API_CHANGE~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9aa854dc6edb139698b309a77c919819baecdbd7;p=php Fix memory leak in touch when safety check fails --- diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index a82a05ed3f..2de03fb9a7 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -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);