ntdll: Handle RtlReAllocateHeap failure in com_class_add_progid (Coverity).

Signed-off-by: Thomas Faber <thomas.faber@reactos.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Thomas Faber 2018-01-16 19:19:34 +01:00 committed by Alexandre Julliard
parent cf629f7edd
commit 42f742e1be
1 changed files with 4 additions and 1 deletions

View File

@ -1453,8 +1453,11 @@ static BOOL com_class_add_progid(const xmlstr_t *progid, struct entity *entity)
if (progids->allocated == progids->num)
{
WCHAR **new_progids = RtlReAllocateHeap(GetProcessHeap(), 0, progids->progids,
2 * progids->allocated * sizeof(WCHAR*));
if (!new_progids) return FALSE;
progids->allocated *= 2;
progids->progids = RtlReAllocateHeap(GetProcessHeap(), 0, progids->progids, progids->allocated * sizeof(WCHAR*));
progids->progids = new_progids;
}
if (!(progids->progids[progids->num] = xmlstrdupW(progid))) return FALSE;