[PATCH] oleaut32: Pass the correct variable to VariantClear

Huw Davies huw at codeweavers.com
Tue Apr 18 03:31:29 CDT 2017


On Tue, Apr 18, 2017 at 04:05:31AM +0000, Alistair Leslie-Hughes wrote:
> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
> ---
>  dlls/oleaut32/vartype.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/dlls/oleaut32/vartype.c b/dlls/oleaut32/vartype.c
> index fc5a025..3513399 100644
> --- a/dlls/oleaut32/vartype.c
> +++ b/dlls/oleaut32/vartype.c
> @@ -136,7 +136,7 @@ static HRESULT VARIANT_FromDisp(IDispatch* pdispIn, LCID lcid, void* pOut,
>      if (SUCCEEDED(hRet))
>      {
>        VARIANT_CopyData(&dstVar, vt, pOut);
> -      VariantClear(&srcVar);
> +      VariantClear(&dstVar);

This isn't right.  In the BSTR case (the only interesting case)
CopyData doesn't allocate a new BSTR, so you would end up free'ing the
BSTR you return.

This VariantClear() should just go away.

Huw.



More information about the wine-devel mailing list