Module: wine Branch: master Commit: d83cf1af0f6b4323000cc9bb4b400dfd92f6a290 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d83cf1af0f6b4323000cc9bb4b...
Author: Huw Davies huw@codeweavers.com Date: Wed Dec 16 10:08:18 2009 +0000
oleaut32: Fix a memory leak.
Found by Valgrind.
---
dlls/oleaut32/variant.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index 10bc8ed..56ab2b3 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -2854,6 +2854,7 @@ HRESULT WINAPI VarCmp(LPVARIANT left, LPVARIANT right, LCID lcid, DWORD flags) if (FAILED(rc)) return rc; rc = VarBstrCmp(V_BSTR(bstrv), V_BSTR(&rv), lcid, flags); + VariantClear(&rv); } else if (V_BSTR(bstrv) && *V_BSTR(bstrv)) { /* Non NULL nor empty BSTR */ /* 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) /* Numeric comparison, will be handled below. VARCMP_NULL used only to break out. */ rc = VARCMP_NULL; - VariantClear(&lv); - VariantClear(&rv); + VariantClear(&lv); + VariantClear(&rv); } else /* Empty or NULL BSTR */ rc = VARCMP_GT;