mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[ACGENRAL] Don't leak memory on failure in InitIgnoreFreeLibrary()
CID 1441306
This commit is contained in:
parent
52da844825
commit
007cc5cd8a
1 changed files with 14 additions and 2 deletions
|
@ -97,7 +97,7 @@ static VOID InitIgnoreFreeLibrary(PCSTR CommandLine)
|
|||
if (!names[n])
|
||||
{
|
||||
SHIM_WARN("Unable to allocate %u bytes\n", cur - prev + 2);
|
||||
return;
|
||||
goto fail;
|
||||
}
|
||||
n++;
|
||||
prev = cur + 1;
|
||||
|
@ -106,11 +106,23 @@ static VOID InitIgnoreFreeLibrary(PCSTR CommandLine)
|
|||
if (!names[n])
|
||||
{
|
||||
SHIM_WARN("Unable to allocate last string\n");
|
||||
return;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
g_Names = names;
|
||||
g_NameCount = count;
|
||||
return;
|
||||
|
||||
fail:
|
||||
--n;
|
||||
while (n >= 0)
|
||||
{
|
||||
if (names[n])
|
||||
ShimLib_ShimFree((PVOID)names[n]);
|
||||
|
||||
--n;
|
||||
}
|
||||
ShimLib_ShimFree(names);
|
||||
}
|
||||
|
||||
BOOL WINAPI SHIM_OBJ_NAME(Notify)(DWORD fdwReason, PVOID ptr)
|
||||
|
|
Loading…
Reference in a new issue