mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
[APPCOMPAT] Fix a memory leak in a failure case (CID 1401161), a 0-length memset that is detected 3 times (CID 1401069, 1401064, 1401062)
svn path=/trunk/; revision=73999
This commit is contained in:
parent
c7991b4c1d
commit
6a3bffaeba
2 changed files with 5 additions and 2 deletions
|
@ -65,7 +65,9 @@ HSDB WINAPI SdbInitDatabase(DWORD flags, LPCWSTR path)
|
|||
case SDB_DATABASE_MAIN_SHIM: name = shim; break;
|
||||
case SDB_DATABASE_MAIN_MSI: name = msi; break;
|
||||
case SDB_DATABASE_MAIN_DRIVERS: name = drivers; break;
|
||||
default: return NULL;
|
||||
default:
|
||||
SdbReleaseDatabase(sdb);
|
||||
return NULL;
|
||||
}
|
||||
SdbGetAppPatchDir(NULL, buffer, 128);
|
||||
memcpy(buffer + lstrlenW(buffer), name, SdbpStrlen(name));
|
||||
|
|
|
@ -39,7 +39,8 @@ PHOOKAPI WINAPI SHIM_OBJ_NAME(GetHookAPIs)(DWORD fdwReason, PCSTR pszCmdLine, PD
|
|||
SHIM_OBJ_NAME(g_szCommandLine) = "";
|
||||
}
|
||||
SHIM_OBJ_NAME(g_pAPIHooks) = ShimLib_ShimMalloc(sizeof(HOOKAPI) * SHIM_NUM_HOOKS);
|
||||
ZeroMemory(SHIM_OBJ_NAME(g_pAPIHooks), sizeof(HOOKAPI) * SHIM_NUM_HOOKS);
|
||||
if (SHIM_NUM_HOOKS)
|
||||
ZeroMemory(SHIM_OBJ_NAME(g_pAPIHooks), sizeof(HOOKAPI) * SHIM_NUM_HOOKS);
|
||||
*pdwHookCount = SHIM_NUM_HOOKS;
|
||||
|
||||
#ifdef SHIM_NOTIFY_FN
|
||||
|
|
Loading…
Reference in a new issue