Commit d83cf1af authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

oleaut32: Fix a memory leak.

Found by Valgrind.
parent 487dc6b6
...@@ -2854,6 +2854,7 @@ HRESULT WINAPI VarCmp(LPVARIANT left, LPVARIANT right, LCID lcid, DWORD flags) ...@@ -2854,6 +2854,7 @@ HRESULT WINAPI VarCmp(LPVARIANT left, LPVARIANT right, LCID lcid, DWORD flags)
if (FAILED(rc)) if (FAILED(rc))
return rc; return rc;
rc = VarBstrCmp(V_BSTR(bstrv), V_BSTR(&rv), lcid, flags); rc = VarBstrCmp(V_BSTR(bstrv), V_BSTR(&rv), lcid, flags);
VariantClear(&rv);
} else if (V_BSTR(bstrv) && *V_BSTR(bstrv)) { } else if (V_BSTR(bstrv) && *V_BSTR(bstrv)) {
/* Non NULL nor empty BSTR */ /* Non NULL nor empty BSTR */
/* If the BSTR is not a number the BSTR is greater */ /* If the BSTR is not a number the BSTR is greater */
...@@ -2869,8 +2870,8 @@ HRESULT WINAPI VarCmp(LPVARIANT left, LPVARIANT right, LCID lcid, DWORD flags) ...@@ -2869,8 +2870,8 @@ HRESULT WINAPI VarCmp(LPVARIANT left, LPVARIANT right, LCID lcid, DWORD flags)
/* Numeric comparison, will be handled below. /* Numeric comparison, will be handled below.
VARCMP_NULL used only to break out. */ VARCMP_NULL used only to break out. */
rc = VARCMP_NULL; rc = VARCMP_NULL;
VariantClear(&lv); VariantClear(&lv);
VariantClear(&rv); VariantClear(&rv);
} else } else
/* Empty or NULL BSTR */ /* Empty or NULL BSTR */
rc = VARCMP_GT; rc = VARCMP_GT;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment