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/rroutput.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/rroutput.c')
-rw-r--r-- | randr/rroutput.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/randr/rroutput.c b/randr/rroutput.c index 7822c0dc3..937b14df0 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -134,8 +134,7 @@ RROutputSetClones (RROutputPtr output, } else newClones = NULL; - if (output->clones) - free(output->clones); + free(output->clones); memcpy (newClones, clones, numClones * sizeof (RROutputPtr)); output->clones = newClones; output->numClones = numClones; @@ -280,8 +279,7 @@ RROutputSetCrtcs (RROutputPtr output, } else newCrtcs = NULL; - if (output->crtcs) - free(output->crtcs); + free(output->crtcs); memcpy (newCrtcs, crtcs, numCrtcs * sizeof (RRCrtcPtr)); output->crtcs = newCrtcs; output->numCrtcs = numCrtcs; @@ -402,13 +400,10 @@ RROutputDestroyResource (pointer value, XID pid) for (m = 0; m < output->numUserModes; m++) RRModeDestroy (output->userModes[m]); - if (output->userModes) - free(output->userModes); + free(output->userModes); - if (output->crtcs) - free(output->crtcs); - if (output->clones) - free(output->clones); + free(output->crtcs); + free(output->clones); RRDeleteAllOutputProperties (output); free(output); return 1; |