From: Ilia Alshanetsky Date: Mon, 17 Apr 2006 23:29:37 +0000 (+0000) Subject: MFH: Fixed Bug #36872 (session_destroy() fails after call to X-Git-Tag: php-4.4.3RC1~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da6fe839bffee6391db848e843aea740de037c75;p=php MFH: Fixed Bug #36872 (session_destroy() fails after call to session_regenerate_id(true)). --- diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 63a51875df..06af01a13d 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -364,10 +364,12 @@ PS_DESTROY_FUNC(files) if (!ps_files_path_create(buf, sizeof(buf), data, key)) return FAILURE; - ps_files_close(data); + if (data->fd != -1) { + ps_files_close(data); - if (VCWD_UNLINK(buf) == -1) { - return FAILURE; + if (VCWD_UNLINK(buf) == -1) { + return FAILURE; + } } return SUCCESS;