Thomas Faber : ntdll: Handle RtlReAllocateHeap failure in com_class_add_progid (Coverity).
Alexandre Julliard
julliard at winehq.org
Fri Jan 19 15:43:20 CST 2018
Module: wine
Branch: master
Commit: 42f742e1be8a4f3b26ed3d1a343f17fe55cbf322
URL: https://source.winehq.org/git/wine.git/?a=commit;h=42f742e1be8a4f3b26ed3d1a343f17fe55cbf322
Author: Thomas Faber <thomas.faber at reactos.org>
Date: Tue Jan 16 19:19:34 2018 +0100
ntdll: Handle RtlReAllocateHeap failure in com_class_add_progid (Coverity).
Signed-off-by: Thomas Faber <thomas.faber at reactos.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/actctx.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c
index 323ee68..b978438 100644
--- a/dlls/ntdll/actctx.c
+++ b/dlls/ntdll/actctx.c
@@ -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;
More information about the wine-cvs
mailing list