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 /xkb/maprules.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 'xkb/maprules.c')
-rw-r--r-- | xkb/maprules.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/xkb/maprules.c b/xkb/maprules.c index 5aabd1c8e..c683c0d4f 100644 --- a/xkb/maprules.c +++ b/xkb/maprules.c @@ -553,9 +553,9 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs) static void FreeMultiDefs(XkbRF_MultiDefsPtr defs) { - if (defs->options) free(defs->options); - if (defs->layout[1]) free(defs->layout[1]); - if (defs->variant[1]) free(defs->variant[1]); + free(defs->options); + free(defs->layout[1]); + free(defs->variant[1]); } static void @@ -988,15 +988,15 @@ XkbRF_GroupPtr group; return; if (rules->rules) { for (i=0,rule=rules->rules;i<rules->num_rules;i++,rule++) { - if (rule->model) free(rule->model); - if (rule->layout) free(rule->layout); - if (rule->variant) free(rule->variant); - if (rule->option) free(rule->option); - if (rule->keycodes) free(rule->keycodes); - if (rule->symbols) free(rule->symbols); - if (rule->types) free(rule->types); - if (rule->compat) free(rule->compat); - if (rule->geometry) free(rule->geometry); + free(rule->model); + free(rule->layout); + free(rule->variant); + free(rule->option); + free(rule->keycodes); + free(rule->symbols); + free(rule->types); + free(rule->compat); + free(rule->geometry); memset((char *)rule, 0, sizeof(XkbRF_RuleRec)); } free(rules->rules); @@ -1006,8 +1006,8 @@ XkbRF_GroupPtr group; if (rules->groups) { for (i=0, group=rules->groups;i<rules->num_groups;i++,group++) { - if (group->name) free(group->name); - if (group->words) free(group->words); + free(group->name); + free(group->words); } free(rules->groups); rules->num_groups= 0; |