summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2012-11-02 18:52:12 +0800
committerXinchen Hui <laruence@php.net>2012-11-02 18:53:06 +0800
commit3fe3029ecb9f121eb6f535970d5cd18ecc8373a6 (patch)
tree4e820d25fe5a0779f656251b144453cddec1f48e /TSRM
parenta2e4404bc8155e6b6d9deefa22a172857d4b5e08 (diff)
downloadphp-git-3fe3029ecb9f121eb6f535970d5cd18ecc8373a6.tar.gz
Fixed bug #62444 (Handle leak in is_readable on windows).
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/tsrm_win32.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index 9e029f60af..03327683cb 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -193,7 +193,7 @@ Finished:
TSRM_API int tsrm_win32_access(const char *pathname, int mode)
{
time_t t;
- HANDLE thread_token;
+ HANDLE thread_token = NULL;
PSID token_sid;
SECURITY_INFORMATION sec_info = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION;
GENERIC_MAPPING gen_map = { FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE, FILE_ALL_ACCESS };
@@ -365,6 +365,9 @@ Finished_Impersonate:
}
Finished:
+ if(thread_token != NULL) {
+ CloseHandle(thread_token);
+ }
if(real_path != NULL) {
free(real_path);
real_path = NULL;