From: Ilia Alshanetsky Date: Tue, 18 Apr 2006 00:31:45 +0000 (+0000) Subject: Commit the actual fix X-Git-Tag: php-5.1.3RC3~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=101d925baaa9791fd3d70e6fe5368e984a36f0b7;p=php Commit the actual fix --- diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 1bdbdfdcde..4c2a0a03d9 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -397,10 +397,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;