qedit: Remove redundant NULL checks before CoTaskMemFree().

Signed-off-by: Michael Stefaniuc <mstefani@redhat.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2016-07-08 10:11:54 +02:00 committed by Alexandre Julliard
parent 5287add1c4
commit 1e662d92ba
1 changed files with 6 additions and 12 deletions

View File

@ -89,8 +89,7 @@ static ULONG WINAPI Single_IEnumMediaTypes_Release(IEnumMediaTypes *iface)
TRACE("(%p) new ref = %u\n", This, refCount); TRACE("(%p) new ref = %u\n", This, refCount);
if (refCount == 0) if (refCount == 0)
{ {
if (This->mtype.pbFormat) CoTaskMemFree(This->mtype.pbFormat);
CoTaskMemFree(This->mtype.pbFormat);
CoTaskMemFree(This); CoTaskMemFree(This);
} }
return refCount; return refCount;
@ -276,10 +275,8 @@ static void SampleGrabber_cleanup(SG_Impl *This)
IMemInputPin_Release(This->memOutput); IMemInputPin_Release(This->memOutput);
if (This->grabberIface) if (This->grabberIface)
ISampleGrabberCB_Release(This->grabberIface); ISampleGrabberCB_Release(This->grabberIface);
if (This->mtype.pbFormat) CoTaskMemFree(This->mtype.pbFormat);
CoTaskMemFree(This->mtype.pbFormat); CoTaskMemFree(This->bufferData);
if (This->bufferData)
CoTaskMemFree(This->bufferData);
if(This->seekthru_unk) if(This->seekthru_unk)
IUnknown_Release(This->seekthru_unk); IUnknown_Release(This->seekthru_unk);
} }
@ -384,8 +381,7 @@ static void SampleGrabber_callback(SG_Impl *This, IMediaSample *sample)
size = 0; size = 0;
EnterCriticalSection(&This->filter.csFilter); EnterCriticalSection(&This->filter.csFilter);
if (This->bufferLen != size) { if (This->bufferLen != size) {
if (This->bufferData) CoTaskMemFree(This->bufferData);
CoTaskMemFree(This->bufferData);
This->bufferData = size ? CoTaskMemAlloc(size) : NULL; This->bufferData = size ? CoTaskMemAlloc(size) : NULL;
This->bufferLen = size; This->bufferLen = size;
} }
@ -586,8 +582,7 @@ SampleGrabber_ISampleGrabber_SetMediaType(ISampleGrabber *iface, const AM_MEDIA_
debugstr_guid(&type->majortype), debugstr_guid(&type->subtype), debugstr_guid(&type->majortype), debugstr_guid(&type->subtype),
type->lSampleSize, type->lSampleSize,
debugstr_guid(&type->formattype), type->cbFormat); debugstr_guid(&type->formattype), type->cbFormat);
if (This->mtype.pbFormat) CoTaskMemFree(This->mtype.pbFormat);
CoTaskMemFree(This->mtype.pbFormat);
This->mtype = *type; This->mtype = *type;
This->mtype.pUnk = NULL; This->mtype.pUnk = NULL;
if (type->cbFormat) { if (type->cbFormat) {
@ -936,8 +931,7 @@ SampleGrabber_In_IPin_ReceiveConnection(IPin *iface, IPin *connector, const AM_M
!IsEqualGUID(&This->sg->mtype.formattype,&FORMAT_None) && !IsEqualGUID(&This->sg->mtype.formattype,&FORMAT_None) &&
!IsEqualGUID(&This->sg->mtype.formattype,&type->formattype)) !IsEqualGUID(&This->sg->mtype.formattype,&type->formattype))
return VFW_E_TYPE_NOT_ACCEPTED; return VFW_E_TYPE_NOT_ACCEPTED;
if (This->sg->mtype.pbFormat) CoTaskMemFree(This->sg->mtype.pbFormat);
CoTaskMemFree(This->sg->mtype.pbFormat);
This->sg->mtype = *type; This->sg->mtype = *type;
This->sg->mtype.pUnk = NULL; This->sg->mtype.pUnk = NULL;
if (type->cbFormat) { if (type->cbFormat) {