]> granicus.if.org Git - python/commitdiff
Issue #10637: Called CloseHandle twice in os.stat/os.lstat (Windows)
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Tue, 7 Dec 2010 10:24:37 +0000 (10:24 +0000)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Tue, 7 Dec 2010 10:24:37 +0000 (10:24 +0000)
Modules/posixmodule.c

index 01da01df280cb23bc5908180c4f5d4c1a29379bc..6f13776cce0588600c6ced3f2ef7e1a25964dd94 100644 (file)
@@ -1159,8 +1159,8 @@ win32_xstat_impl(const char *path, struct win32_stat *result, BOOL traverse, int
                 free(target_path);
                 return code;
             }
-        }
-        CloseHandle(hFile);
+        } else
+            CloseHandle(hFile);
     }
     attribute_data_to_stat(&info, reparse_tag, result);
 
@@ -1232,8 +1232,8 @@ win32_xstat_impl_w(const wchar_t *path, struct win32_stat *result, BOOL traverse
                 free(target_path);
                 return code;
             }
-        }
-        CloseHandle(hFile);
+        } else
+            CloseHandle(hFile);
     }
     attribute_data_to_stat(&info, reparse_tag, result);