]> granicus.if.org Git - php/commitdiff
MFH: Fixed Bug #36872 (session_destroy() fails after call to
authorIlia Alshanetsky <iliaa@php.net>
Mon, 17 Apr 2006 23:29:37 +0000 (23:29 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 17 Apr 2006 23:29:37 +0000 (23:29 +0000)
session_regenerate_id(true)).

ext/session/mod_files.c

index 63a51875df50ae7e3b93f8bb2c003687eab59dbd..06af01a13d55bf0c9406fa8e01239a450c8cc373 100644 (file)
@@ -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;