mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 09:41:41 +00:00
setupapi: Fix memory leak on realloc failure in RetreiveFileSecurity.
This commit is contained in:
parent
7077c5bcab
commit
002057543d
|
@ -740,7 +740,7 @@ fail:;
|
|||
DWORD WINAPI RetreiveFileSecurity(LPCWSTR lpFileName,
|
||||
PSECURITY_DESCRIPTOR *pSecurityDescriptor)
|
||||
{
|
||||
PSECURITY_DESCRIPTOR SecDesc;
|
||||
SECURITY_DESCRIPTOR *SecDesc, *NewSecDesc;
|
||||
DWORD dwSize = 0x100;
|
||||
DWORD dwError;
|
||||
|
||||
|
@ -763,9 +763,13 @@ DWORD WINAPI RetreiveFileSecurity(LPCWSTR lpFileName,
|
|||
return dwError;
|
||||
}
|
||||
|
||||
SecDesc = MyRealloc(SecDesc, dwSize);
|
||||
if (SecDesc == NULL)
|
||||
NewSecDesc = MyRealloc(SecDesc, dwSize);
|
||||
if (NewSecDesc == NULL)
|
||||
{
|
||||
MyFree(SecDesc);
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
SecDesc = NewSecDesc;
|
||||
|
||||
if (GetFileSecurityW(lpFileName, OWNER_SECURITY_INFORMATION |
|
||||
GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
|
||||
|
|
Loading…
Reference in a new issue