Commit f830a12d authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

oleaut32: Remove redundant NULL check before SysFreeString (Smatch).

parent 1949a8c2
......@@ -419,7 +419,6 @@ INT WINAPI SysReAllocString(LPBSTR old,LPCOLESTR str)
/*
* Make sure we free the old string.
*/
if (*old!=NULL)
SysFreeString(*old);
/*
......
......@@ -314,7 +314,6 @@ static HRESULT SAFEARRAY_DestroyData(SAFEARRAY *psa, ULONG ulStartCell)
while(ulCellCount--)
{
if (*lpBstr)
SysFreeString(*lpBstr);
lpBstr++;
}
......@@ -865,7 +864,6 @@ HRESULT WINAPI SafeArrayPutElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData
BSTR lpBstr = (BSTR)pvData;
BSTR* lpDest = (BSTR*)lpvDest;
if (*lpDest)
SysFreeString(*lpDest);
*lpDest = SysAllocStringByteLen((char*)lpBstr, SysStringByteLen(lpBstr));
......
......@@ -187,11 +187,8 @@ unsigned char * WINAPI BSTR_UserUnmarshal(ULONG *pFlags, unsigned char *Buffer,
if(header->len != header->len2)
FIXME("len %08x != len2 %08x\n", header->len, header->len2);
if(*pstr)
{
SysFreeString(*pstr);
*pstr = NULL;
}
if(header->byte_len != 0xffffffff)
*pstr = SysAllocStringByteLen((char*)(header + 1), header->byte_len);
......@@ -203,11 +200,8 @@ unsigned char * WINAPI BSTR_UserUnmarshal(ULONG *pFlags, unsigned char *Buffer,
void WINAPI BSTR_UserFree(ULONG *pFlags, BSTR *pstr)
{
TRACE("(%x,%p) => %p\n", *pFlags, pstr, *pstr);
if (*pstr)
{
SysFreeString(*pstr);
*pstr = NULL;
}
}
/* VARIANT */
......
......@@ -608,7 +608,6 @@ HRESULT WINAPI VariantClear(VARIANTARG* pVarg)
}
else if (V_VT(pVarg) == VT_BSTR)
{
if (V_BSTR(pVarg))
SysFreeString(V_BSTR(pVarg));
}
else if (V_VT(pVarg) == VT_RECORD)
......
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