Dmitry Timoshkov : oleaut32: ICreateTypeInfo2::AddVarDesc() should handle failure of allocation and initialization of a variant description.

Alexandre Julliard julliard at winehq.org
Thu Jul 1 15:53:50 CDT 2021


Module: wine
Branch: master
Commit: d3d6f94ab13af83ce803209450b52ecb7abaf480
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d3d6f94ab13af83ce803209450b52ecb7abaf480

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Fri Jun 25 13:12:11 2021 +0300

oleaut32: ICreateTypeInfo2::AddVarDesc() should handle failure of allocation and initialization of a variant description.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/oleaut32/typelib.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 4669b03d5fc..0526af0abdb 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -11019,6 +11019,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddVarDesc(ICreateTypeInfo2 *iface,
 {
     ITypeInfoImpl *This = info_impl_from_ICreateTypeInfo2(iface);
     TLBVarDesc *var_desc;
+    HRESULT hr;
 
     TRACE("%p %u %p\n", This, index, varDesc);
 
@@ -11044,7 +11045,9 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddVarDesc(ICreateTypeInfo2 *iface,
         var_desc = This->vardescs = heap_alloc_zero(sizeof(TLBVarDesc));
 
     TLBVarDesc_Constructor(var_desc);
-    TLB_AllocAndInitVarDesc(varDesc, &var_desc->vardesc_create);
+    hr = TLB_AllocAndInitVarDesc(varDesc, &var_desc->vardesc_create);
+    if (FAILED(hr))
+        return hr;
     var_desc->vardesc = *var_desc->vardesc_create;
 
     ++This->typeattr.cVars;




More information about the wine-cvs mailing list