mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-20 16:01:10 +08:00
Don't free statically allocated sys_privs
commit 67fd2101 introduced a bad bug. Changing sys_privs to a static area and just returning a pointer is nice... *if* the calling code doesn't call free() on it. Make sure callers check pointer for sys_privs and refrain from calling free, if so. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
61f181d6b8
commit
838cfa352c
@ -993,7 +993,7 @@ out:
|
||||
pop_self_privilege ();
|
||||
if (token != INVALID_HANDLE_VALUE)
|
||||
CloseHandle (token);
|
||||
if (privs)
|
||||
if (privs && privs != (PTOKEN_PRIVILEGES) &sys_privs)
|
||||
free (privs);
|
||||
lsa_close_policy (lsa);
|
||||
|
||||
@ -1229,7 +1229,7 @@ lsaauth (cygsid &usersid, user_groups &new_groups)
|
||||
user_token = get_full_privileged_inheritable_token (user_token);
|
||||
|
||||
out:
|
||||
if (privs)
|
||||
if (privs && privs != (PTOKEN_PRIVILEGES) &sys_privs)
|
||||
free (privs);
|
||||
lsa_close_policy (lsa);
|
||||
if (lsa_hdl)
|
||||
|
Loading…
x
Reference in New Issue
Block a user