[RTL] Handle RtlReAllocateHeap failure in com_class_add_progid. CID 1223161

This commit is contained in:
Thomas Faber 2018-01-20 09:47:24 +01:00
parent 73e6bc960a
commit 095a4d1d23
No known key found for this signature in database
GPG key ID: 076E7C3D44720826

View file

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