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/rrproperty.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/rrproperty.c')
-rw-r--r-- | randr/rrproperty.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/randr/rrproperty.c b/randr/rrproperty.c index 5e37577b8..a4402e147 100644 --- a/randr/rrproperty.c +++ b/randr/rrproperty.c @@ -69,10 +69,8 @@ RRDeleteAllOutputProperties (RROutputPtr output) event.atom = prop->propertyName; event.timestamp = currentTime.milliseconds; RRDeliverPropertyEvent (output->pScreen, (xEvent *)&event); - if (prop->current.data) - free(prop->current.data); - if (prop->pending.data) - free(prop->pending.data); + free(prop->current.data); + free(prop->pending.data); free(prop); } } @@ -109,14 +107,10 @@ RRCreateOutputProperty (Atom property) static void RRDestroyOutputProperty (RRPropertyPtr prop) { - if (prop->valid_values) - free(prop->valid_values); - if (prop->current.data) - free(prop->current.data); - if (prop->pending.data) - free(prop->pending.data); - if (prop->valid_values) - free(prop->valid_values); + free(prop->valid_values); + free(prop->current.data); + free(prop->pending.data); + free(prop->valid_values); free(prop); } @@ -232,12 +226,10 @@ RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type, !pScrPriv->rrOutputSetProperty(output->pScreen, output, prop->propertyName, &new_value)) { - if (new_value.data) - free(new_value.data); + free(new_value.data); return (BadValue); } - if (prop_value->data) - free(prop_value->data); + free(prop_value->data); *prop_value = new_value; } @@ -378,8 +370,7 @@ RRConfigureOutputProperty (RROutputPtr output, Atom property, */ if (prop->is_pending && !pending) { - if (prop->pending.data) - free(prop->pending.data); + free(prop->pending.data); RRInitOutputPropertyValue (&prop->pending); } @@ -387,8 +378,7 @@ RRConfigureOutputProperty (RROutputPtr output, Atom property, prop->range = range; prop->immutable = immutable; prop->num_valid = num_values; - if (prop->valid_values) - free(prop->valid_values); + free(prop->valid_values); prop->valid_values = new_values; if (add) { |