From 0a4d8cbdcd7b25313fb29ccdb498044af95f7de6 Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Sun, 6 Jun 2010 15:28:30 +0700 Subject: Remove more superfluous if(p) checks around free(p) This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ -if(E) { free(E); } +free(E); Signed-off-by: Mikhail Gusarov Reviewed-by: Julien Cristau Reviewed-by: Fernando Carrijo Reviewed-by: Matt Turner --- record/record.c | 8 +++----- record/set.c | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'record') diff --git a/record/record.c b/record/record.c index 5bd46c29e..53bdfec71 100644 --- a/record/record.c +++ b/record/record.c @@ -1868,8 +1868,7 @@ bailout: if (si) { for (i = 0; i < maxSets; i++) - if (si[i].intervals) - free(si[i].intervals); + free(si[i].intervals); free(si); } if (pCanonClients && pCanonClients != (XID *)&stuff[1]) @@ -1955,8 +1954,7 @@ ProcRecordCreateContext(ClientPtr client) err = BadAlloc; } bailout: - if (pContext) - free(pContext); + free(pContext); return err; } /* ProcRecordCreateContext */ @@ -2352,7 +2350,7 @@ ProcRecordGetContext(ClientPtr client) bailout: for (i = 0; i < nRCAPs; i++) { - if (pRangeInfo[i].pRanges) free(pRangeInfo[i].pRanges); + free(pRangeInfo[i].pRanges); } free(pRangeInfo); return err; diff --git a/record/set.c b/record/set.c index f2064fd3c..a9a6a4465 100644 --- a/record/set.c +++ b/record/set.c @@ -360,7 +360,7 @@ IntervalListCreateSet(RecordSetInterval *pIntervals, int nIntervals, memcpy(&prls[1], stackIntervals, nIntervals * sizeof(RecordSetInterval)); prls->nIntervals = nIntervals; bailout: - if (stackIntervals) free(stackIntervals); + free(stackIntervals); return (RecordSetPtr)prls; } -- cgit v1.2.3