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 /Xext | |
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 'Xext')
-rw-r--r-- | Xext/panoramiX.c | 3 | ||||
-rw-r--r-- | Xext/security.c | 2 | ||||
-rw-r--r-- | Xext/xace.c | 2 | ||||
-rw-r--r-- | Xext/xvmc.c | 9 |
4 files changed, 6 insertions, 10 deletions
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 1cb58b59f..27ca01f6c 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -1276,8 +1276,7 @@ XineramaGetImageData( } - if(ScratchMem) - free(ScratchMem); + free(ScratchMem); RegionUninit(&SrcRegion); RegionUninit(&GrabRegion); diff --git a/Xext/security.c b/Xext/security.c index 12210f8bc..9ef6d19d6 100644 --- a/Xext/security.c +++ b/Xext/security.c @@ -604,7 +604,7 @@ bailout: if (removeAuth) RemoveAuthorization(stuff->nbytesAuthProto, protoname, authdata_len, pAuthdata); - if (pAuth) free(pAuth); + free(pAuth); return err; } /* ProcSecurityGenerateAuthorization */ diff --git a/Xext/xace.c b/Xext/xace.c index abd469085..e10d83716 100644 --- a/Xext/xace.c +++ b/Xext/xace.c @@ -323,7 +323,7 @@ XaceCensorImage( */ memset(pBuf, 0, (int)(widthBytesLine * h)); } - if (pRects) free(pRects); + free(pRects); if (pScratchGC) FreeScratchGC(pScratchGC); if (pPix) FreeScratchPixmapHeader(pPix); } diff --git a/Xext/xvmc.c b/Xext/xvmc.c index 982fad13f..8fbdfaedd 100644 --- a/Xext/xvmc.c +++ b/Xext/xvmc.c @@ -259,8 +259,7 @@ ProcXvMCCreateContext(ClientPtr client) WriteToClient(client, dwords << 2, (char*)data); AddResource(pContext->context_id, XvMCRTContext, pContext); - if(data) - free(data); + free(data); return Success; } @@ -327,8 +326,7 @@ ProcXvMCCreateSurface(ClientPtr client) WriteToClient(client, dwords << 2, (char*)data); AddResource(pSurface->surface_id, XvMCRTSurface, pSurface); - if(data) - free(data); + free(data); pContext->refcnt++; @@ -444,8 +442,7 @@ ProcXvMCCreateSubpicture(ClientPtr client) WriteToClient(client, dwords << 2, (char*)data); AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture); - if(data) - free(data); + free(data); pContext->refcnt++; |