oleaut32: Remove redundant NULL check before SysFreeString (Smatch).
This commit is contained in:
parent
1949a8c245
commit
f830a12ddb
|
@ -419,8 +419,7 @@ INT WINAPI SysReAllocString(LPBSTR old,LPCOLESTR str)
|
|||
/*
|
||||
* Make sure we free the old string.
|
||||
*/
|
||||
if (*old!=NULL)
|
||||
SysFreeString(*old);
|
||||
SysFreeString(*old);
|
||||
|
||||
/*
|
||||
* Allocate the new string
|
||||
|
|
|
@ -314,8 +314,7 @@ static HRESULT SAFEARRAY_DestroyData(SAFEARRAY *psa, ULONG ulStartCell)
|
|||
|
||||
while(ulCellCount--)
|
||||
{
|
||||
if (*lpBstr)
|
||||
SysFreeString(*lpBstr);
|
||||
SysFreeString(*lpBstr);
|
||||
lpBstr++;
|
||||
}
|
||||
}
|
||||
|
@ -865,8 +864,7 @@ HRESULT WINAPI SafeArrayPutElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData
|
|||
BSTR lpBstr = (BSTR)pvData;
|
||||
BSTR* lpDest = (BSTR*)lpvDest;
|
||||
|
||||
if (*lpDest)
|
||||
SysFreeString(*lpDest);
|
||||
SysFreeString(*lpDest);
|
||||
|
||||
*lpDest = SysAllocStringByteLen((char*)lpBstr, SysStringByteLen(lpBstr));
|
||||
if (!*lpDest)
|
||||
|
|
|
@ -186,12 +186,9 @@ unsigned char * WINAPI BSTR_UserUnmarshal(ULONG *pFlags, unsigned char *Buffer,
|
|||
header = (bstr_wire_t*)Buffer;
|
||||
if(header->len != header->len2)
|
||||
FIXME("len %08x != len2 %08x\n", header->len, header->len2);
|
||||
|
||||
if(*pstr)
|
||||
{
|
||||
SysFreeString(*pstr);
|
||||
*pstr = NULL;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
SysFreeString(*pstr);
|
||||
*pstr = NULL;
|
||||
}
|
||||
|
||||
/* VARIANT */
|
||||
|
|
|
@ -608,8 +608,7 @@ HRESULT WINAPI VariantClear(VARIANTARG* pVarg)
|
|||
}
|
||||
else if (V_VT(pVarg) == VT_BSTR)
|
||||
{
|
||||
if (V_BSTR(pVarg))
|
||||
SysFreeString(V_BSTR(pVarg));
|
||||
SysFreeString(V_BSTR(pVarg));
|
||||
}
|
||||
else if (V_VT(pVarg) == VT_RECORD)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue