diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-06-06 15:28:30 +0700 |
---|---|---|
committer | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-06-06 20:27:18 +0700 |
commit | 0a4d8cbdcd7b25313fb29ccdb498044af95f7de6 (patch) | |
tree | 3534c9035180b7e0d2ebbbf0202a370cb61f8e8d /hw/xfree86/xaa | |
parent | 5a0fc0ad21d562612676ef88ef2d533b2391810a (diff) |
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 <dottedmag@dottedmag.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'hw/xfree86/xaa')
-rw-r--r-- | hw/xfree86/xaa/xaaCpyArea.c | 4 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaGC.c | 3 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaInit.c | 6 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaLineMisc.c | 3 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaPCache.c | 18 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaTEText.c | 3 |
6 files changed, 13 insertions, 24 deletions
diff --git a/hw/xfree86/xaa/xaaCpyArea.c b/hw/xfree86/xaa/xaaCpyArea.c index 443a0e15e..bcf81ee99 100644 --- a/hw/xfree86/xaa/xaaCpyArea.c +++ b/hw/xfree86/xaa/xaaCpyArea.c @@ -148,8 +148,8 @@ XAADoBitBlt( pboxNew2 = (BoxPtr)malloc(sizeof(BoxRec) * nbox); pptNew2 = (DDXPointPtr)malloc(sizeof(DDXPointRec) * nbox); if(!pboxNew2 || !pptNew2) { - if (pptNew2) free(pptNew2); - if (pboxNew2) free(pboxNew2); + free(pptNew2); + free(pboxNew2); if (pboxNew1) { free(pptNew1); free(pboxNew1); diff --git a/hw/xfree86/xaa/xaaGC.c b/hw/xfree86/xaa/xaaGC.c index 8c9d0ede7..fbef88d77 100644 --- a/hw/xfree86/xaa/xaaGC.c +++ b/hw/xfree86/xaa/xaaGC.c @@ -243,8 +243,7 @@ XAADestroyGC(GCPtr pGC) if(pGCPriv->XAAOps != &XAAFallbackOps) free(pGCPriv->XAAOps); - if(pGCPriv->DashPattern) - free(pGCPriv->DashPattern); + free(pGCPriv->DashPattern); (*pGC->funcs->DestroyGC)(pGC); XAA_GC_FUNC_EPILOGUE (pGC); diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c index d0a66b8d8..ec55632e9 100644 --- a/hw/xfree86/xaa/xaaInit.c +++ b/hw/xfree86/xaa/xaaInit.c @@ -84,11 +84,9 @@ XAADestroyInfoRec(XAAInfoRecPtr infoRec) if(infoRec->ClosePixmapCache) (*infoRec->ClosePixmapCache)(infoRec->pScrn->pScreen); - if(infoRec->PreAllocMem) - free(infoRec->PreAllocMem); + free(infoRec->PreAllocMem); - if(infoRec->PixmapCachePrivate) - free(infoRec->PixmapCachePrivate); + free(infoRec->PixmapCachePrivate); free(infoRec); } diff --git a/hw/xfree86/xaa/xaaLineMisc.c b/hw/xfree86/xaa/xaaLineMisc.c index e017c22f8..ed3cd486b 100644 --- a/hw/xfree86/xaa/xaaLineMisc.c +++ b/hw/xfree86/xaa/xaaLineMisc.c @@ -74,8 +74,7 @@ XAAComputeDash(GCPtr pGC) int shift, value, direction; Bool set; - if(pGCPriv->DashPattern) - free(pGCPriv->DashPattern); + free(pGCPriv->DashPattern); pGCPriv->DashPattern = NULL; pGCPriv->DashLength = 0; diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c index f7f6a29bb..86ac1cd14 100644 --- a/hw/xfree86/xaa/xaaPCache.c +++ b/hw/xfree86/xaa/xaaPCache.c @@ -144,18 +144,12 @@ FreePixmapCachePrivate(XAAPixmapCachePrivatePtr pPriv) { if(!pPriv) return; - if(pPriv->Info512) - free(pPriv->Info512); - if(pPriv->Info256) - free(pPriv->Info256); - if(pPriv->Info128) - free(pPriv->Info128); - if(pPriv->InfoColor) - free(pPriv->InfoColor); - if(pPriv->InfoMono) - free(pPriv->InfoMono); - if(pPriv->InfoPartial) - free(pPriv->InfoPartial); + free(pPriv->Info512); + free(pPriv->Info256); + free(pPriv->Info128); + free(pPriv->InfoColor); + free(pPriv->InfoMono); + free(pPriv->InfoPartial); free(pPriv); } diff --git a/hw/xfree86/xaa/xaaTEText.c b/hw/xfree86/xaa/xaaTEText.c index 729e8a8cb..41c0ebcfd 100644 --- a/hw/xfree86/xaa/xaaTEText.c +++ b/hw/xfree86/xaa/xaaTEText.c @@ -299,8 +299,7 @@ XAAGlyphBltTEColorExpansion( skippix, ytop - Top, glyphs + skipglyphs, glyphWidth, fg, bg, rop, planemask); - if (fallbackBits) - free(fallbackBits); + free(fallbackBits); } nbox--; pbox++; |