From b5a7853b861c02f350935813b7503a28d38fa7f6 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Fri, 8 Jul 2016 10:10:14 +0200 Subject: [PATCH] quartz: Remove redundant NULL checks before CoTaskMemFree(). Signed-off-by: Michael Stefaniuc Signed-off-by: Alexandre Julliard --- dlls/quartz/avidec.c | 7 ++----- dlls/quartz/filtermapper.c | 3 +-- dlls/quartz/mpegsplit.c | 3 +-- dlls/quartz/tests/filtermapper.c | 3 +-- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/dlls/quartz/avidec.c b/dlls/quartz/avidec.c index eb9b223f5c1..7e29318989e 100644 --- a/dlls/quartz/avidec.c +++ b/dlls/quartz/avidec.c @@ -349,11 +349,8 @@ static HRESULT WINAPI AVIDec_BreakConnect(TransformFilter *tf, PIN_DIRECTION dir { if (This->hvid) ICClose(This->hvid); - if (This->pBihIn) - CoTaskMemFree(This->pBihIn); - if (This->pBihOut) - CoTaskMemFree(This->pBihOut); - + CoTaskMemFree(This->pBihIn); + CoTaskMemFree(This->pBihOut); This->hvid = NULL; This->pBihIn = NULL; This->pBihOut = NULL; diff --git a/dlls/quartz/filtermapper.c b/dlls/quartz/filtermapper.c index 656415523e4..8a1fc3ad30f 100644 --- a/dlls/quartz/filtermapper.c +++ b/dlls/quartz/filtermapper.c @@ -609,8 +609,7 @@ static void FM2_DeleteRegFilter(REGFILTER2 * prf2) for (i = 0; i < prf2->u.s2.cPins2; i++) { UINT j; - if (prf2->u.s2.rgPins2[i].clsPinCategory) - CoTaskMemFree((LPVOID)prf2->u.s2.rgPins2[i].clsPinCategory); + CoTaskMemFree((void*)prf2->u.s2.rgPins2[i].clsPinCategory); for (j = 0; j < prf2->u.s2.rgPins2[i].nMediaTypes; j++) { diff --git a/dlls/quartz/mpegsplit.c b/dlls/quartz/mpegsplit.c index 1fd80024d1a..9b581e99d63 100644 --- a/dlls/quartz/mpegsplit.c +++ b/dlls/quartz/mpegsplit.c @@ -589,8 +589,7 @@ static HRESULT MPEGSplitter_pre_connect(IPin *iface, IPin *pConnectPin, ALLOCATO if (FAILED(hr)) { - if (amt.pbFormat) - CoTaskMemFree(amt.pbFormat); + CoTaskMemFree(amt.pbFormat); ERR("Could not create pin for MPEG audio stream (%x)\n", hr); break; } diff --git a/dlls/quartz/tests/filtermapper.c b/dlls/quartz/tests/filtermapper.c index 11b7d39bfd9..f044a31f9c0 100644 --- a/dlls/quartz/tests/filtermapper.c +++ b/dlls/quartz/tests/filtermapper.c @@ -528,8 +528,7 @@ static void test_parse_filter_data(void) ok(pRegFilter->dwMerit == 0x5fffff,"Incorrect merit returned\n"); out: - if (pRegFilter) - CoTaskMemFree(pRegFilter); + CoTaskMemFree(pRegFilter); if (psa) { SafeArrayUnaccessData(psa);