-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Update TSRM/tsrm_win32.c #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,7 +193,7 @@ PSID tsrm_win32_get_token_sid(HANDLE hToken) | |
TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC) | ||
{ | ||
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 }; | ||
|
@@ -363,6 +363,10 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC) | |
} | ||
|
||
Finished: | ||
if(thread_token != NULL) { | ||
CloseHandle(thread_token); | ||
} | ||
|
||
if(real_path != NULL) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh.. there is another one, i know it's not your change, you could fix it in your commit I think :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please don't, only change the codes related to the fix. thanks |
||
free(real_path); | ||
real_path = NULL; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, according to the CS, there should a space after
if