https://git.reactos.org/?p=reactos.git;a=commitdiff;h=095a4d1d23681b3a101e3…
commit 095a4d1d23681b3a101e38324fec3d9434bc5d58
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sat Jan 20 09:47:24 2018 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sat Jan 20 09:48:07 2018 +0100
[RTL] Handle RtlReAllocateHeap failure in com_class_add_progid. CID 1223161
---
sdk/lib/rtl/actctx.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sdk/lib/rtl/actctx.c b/sdk/lib/rtl/actctx.c
index 4cf9bbaa4b..6ce1734017 100644
--- a/sdk/lib/rtl/actctx.c
+++ b/sdk/lib/rtl/actctx.c
@@ -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;