Skip to content

Commit 3fe3029

Browse files
committed
Fixed bug #62444 (Handle leak in is_readable on windows).
1 parent a2e4404 commit 3fe3029

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

NEWS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ PHP NEWS
33
?? ??? 2012, PHP 5.3.19
44

55
- Core
6-
. Fixed bug #63241 PHP fails to open Windows deduplicated files.
6+
. Fixed bug #63241 (PHP fails to open Windows deduplicated files).
77
(daniel dot stelter-gliese at innogames dot de)
8+
. Fixed bug #62444 (Handle leak in is_readable on windows).
9+
(krazyest at seznam dot cz)
810

911
- Libxml
1012
. Fixed bug #63389 (Missing context check on libxml_set_streams_context()

TSRM/tsrm_win32.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ PSID tsrm_win32_get_token_sid(HANDLE hToken)
193193
TSRM_API int tsrm_win32_access(const char *pathname, int mode)
194194
{
195195
time_t t;
196-
HANDLE thread_token;
196+
HANDLE thread_token = NULL;
197197
PSID token_sid;
198198
SECURITY_INFORMATION sec_info = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION;
199199
GENERIC_MAPPING gen_map = { FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE, FILE_ALL_ACCESS };
@@ -365,6 +365,9 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
365365
}
366366

367367
Finished:
368+
if(thread_token != NULL) {
369+
CloseHandle(thread_token);
370+
}
368371
if(real_path != NULL) {
369372
free(real_path);
370373
real_path = NULL;

0 commit comments

Comments
 (0)