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 /randr/rrcrtc.c | |
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 'randr/rrcrtc.c')
-rw-r--r-- | randr/rrcrtc.c | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 987f77233..f5fe76512 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -190,8 +190,7 @@ RRCrtcNotify (RRCrtcPtr crtc, } else { - if (crtc->outputs) - free(crtc->outputs); + free(crtc->outputs); newoutputs = NULL; } crtc->outputs = newoutputs; @@ -440,8 +439,7 @@ RRCrtcDestroyResource (pointer value, XID pid) } } } - if (crtc->gammaRed) - free(crtc->gammaRed); + free(crtc->gammaRed); if (crtc->mode) RRModeDestroy (crtc->mode); free(crtc); @@ -563,8 +561,7 @@ RRCrtcGammaSetSize (RRCrtcPtr crtc, } else gamma = NULL; - if (crtc->gammaRed) - free(crtc->gammaRed); + free(crtc->gammaRed); crtc->gammaRed = gamma; crtc->gammaGreen = gamma + size; crtc->gammaBlue = gamma + size*2; @@ -805,8 +802,7 @@ ProcRRSetCrtcConfig (ClientPtr client) RROutputType, client, DixSetAttrAccess); if (rc != Success) { - if (outputs) - free(outputs); + free(outputs); return rc; } /* validate crtc for this output */ @@ -815,8 +811,7 @@ ProcRRSetCrtcConfig (ClientPtr client) break; if (j == outputs[i]->numCrtcs) { - if (outputs) - free(outputs); + free(outputs); return BadMatch; } /* validate mode for this output */ @@ -830,8 +825,7 @@ ProcRRSetCrtcConfig (ClientPtr client) } if (j == outputs[i]->numModes + outputs[i]->numUserModes) { - if (outputs) - free(outputs); + free(outputs); return BadMatch; } } @@ -850,8 +844,7 @@ ProcRRSetCrtcConfig (ClientPtr client) } if (k == outputs[i]->numClones) { - if (outputs) - free(outputs); + free(outputs); return BadMatch; } } @@ -900,8 +893,7 @@ ProcRRSetCrtcConfig (ClientPtr client) * Invalid rotation */ client->errorValue = stuff->rotation; - if (outputs) - free(outputs); + free(outputs); return BadValue; } @@ -913,8 +905,7 @@ ProcRRSetCrtcConfig (ClientPtr client) * requested rotation or reflection not supported by screen */ client->errorValue = stuff->rotation; - if (outputs) - free(outputs); + free(outputs); return BadMatch; } @@ -943,16 +934,14 @@ ProcRRSetCrtcConfig (ClientPtr client) if (stuff->x + source_width > pScreen->width) { client->errorValue = stuff->x; - if (outputs) - free(outputs); + free(outputs); return BadValue; } if (stuff->y + source_height > pScreen->height) { client->errorValue = stuff->y; - if (outputs) - free(outputs); + free(outputs); return BadValue; } } @@ -979,8 +968,7 @@ ProcRRSetCrtcConfig (ClientPtr client) pScrPriv->lastSetTime = time; sendReply: - if (outputs) - free(outputs); + free(outputs); rep.type = X_Reply; /* rep.status has already been filled in */ |