Robert Shearman : oleaut32: Initialize pRetVal in ITypeInfo:: Invoke before calling VariantCopyInd

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 24 06:55:10 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: eb885a750f0677cb2d50f4969862065962471431
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=eb885a750f0677cb2d50f4969862065962471431

Author: Robert Shearman <rob at codeweavers.com>
Date:   Mon Jul 24 11:45:30 2006 +0100

oleaut32: Initialize pRetVal in ITypeInfo::Invoke before calling VariantCopyInd
as native doesn't assume that it doesn't contain valid data.

---

 dlls/oleaut32/typelib.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 52aae92..3ba1b4e 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -5391,8 +5391,11 @@ static HRESULT WINAPI ITypeInfo_fnInvoke
                     }
 
                     if (pVarResult)
+                    {
+                        VariantInit(pVarResult);
                         /* deref return value */
                         hres = VariantCopyInd(pVarResult, prgpvarg[i]);
+                    }
 
                     /* free data stored in varresult. Note that
                      * VariantClear doesn't do what we want because we are




More information about the wine-cvs mailing list