diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c index babe468a3a..821fb869e5 100644 --- a/dlls/advapi32/security.c +++ b/dlls/advapi32/security.c @@ -3118,8 +3118,11 @@ DWORD WINAPI GetSecurityInfo( } if (ppSecurityDescriptor) *ppSecurityDescriptor = sd; - else - LocalFree(sd); + + /* The security descriptor (sd) cannot be freed if ppSecurityDescriptor is + * NULL, because native happily returns the SIDs and ACLs that are requested + * in this case. + */ return ERROR_SUCCESS; }