mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
- fix leak when the SID is already used and duplicated
This commit is contained in:
parent
eb1dc0babf
commit
79aa615b55
1 changed files with 4 additions and 0 deletions
|
@ -170,6 +170,7 @@ PSID tsrm_win32_get_token_sid(HANDLE hToken)
|
||||||
|
|
||||||
/* ConvertSidToStringSid(pTokenUser->User.Sid, &ptcSidOwner); */
|
/* ConvertSidToStringSid(pTokenUser->User.Sid, &ptcSidOwner); */
|
||||||
pResultSid = malloc(sid_len);
|
pResultSid = malloc(sid_len);
|
||||||
|
|
||||||
if (!pResultSid) {
|
if (!pResultSid) {
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
@ -271,6 +272,9 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||||
if (!DuplicateToken(thread_token, SecurityImpersonation, &TWG(impersonation_token))) {
|
if (!DuplicateToken(thread_token, SecurityImpersonation, &TWG(impersonation_token))) {
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
/* we already have it, free it then */
|
||||||
|
free(token_sid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CWDG(realpath_cache_size_limit)) {
|
if (CWDG(realpath_cache_size_limit)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue