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

ext/session/mod_files.c

index 1bdbdfdcde3097834a8859e477d4d18e95bf0c6d..4c2a0a03d9f3e0fe4accc1f3887738b9b70b7e5d 100644 (file)
@@ -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;