From 9aa854dc6edb139698b309a77c919819baecdbd7 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Thu, 27 Jul 2000 13:28:21 +0000 Subject: [PATCH] Fix memory leak in touch when safety check fails --- ext/standard/filestat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.50.1