oleaut32: Fix double-free in tests.

Found by Valgrind.
This commit is contained in:
Huw Davies 2009-12-11 13:28:19 +00:00 committed by Alexandre Julliard
parent 7f9d5aad7c
commit 026576995e
1 changed files with 3 additions and 2 deletions

View File

@ -4889,7 +4889,8 @@ static void test_VarBstrFromR4(void)
}
}
#define BSTR_DATE(dt,str) SysFreeString(bstr); bstr = NULL; \
#define BSTR_DATE(dt,str) \
bstr = NULL; \
hres = pVarBstrFromDate(dt,lcid,LOCALE_NOUSEROVERRIDE,&bstr); \
if (bstr) {WideCharToMultiByte(CP_ACP, 0, bstr, -1, buff, sizeof(buff), 0, 0); SysFreeString(bstr);} \
else buff[0] = 0; \
@ -4901,7 +4902,7 @@ static void test_VarBstrFromDate(void)
char buff[256];
LCID lcid;
HRESULT hres;
BSTR bstr = NULL;
BSTR bstr;
CHECKPTR(VarBstrFromDate);
lcid = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT);