summaryrefslogtreecommitdiff
path: root/hw/kdrive/src/kinfo.c
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2010-01-02 05:43:26 +0600
committerKeith Packard <keithp@keithp.com>2010-01-01 23:27:53 -0800
commit2c85d72fc7bd013af327321ad5d626dc73c3caf0 (patch)
tree4b702217f44a81bd00abd7d3ef39d6f79d477093 /hw/kdrive/src/kinfo.c
parent15bc35c6e44c65812de5c3e85ec8bbf78b032ded (diff)
Do not check xfree argument for NULL
xfree itself checks for NULL, and even this is not necessary as passing NULL to free(3) is safe. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/kdrive/src/kinfo.c')
-rw-r--r--hw/kdrive/src/kinfo.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/hw/kdrive/src/kinfo.c b/hw/kdrive/src/kinfo.c
index af6415690..95afc7963 100644
--- a/hw/kdrive/src/kinfo.c
+++ b/hw/kdrive/src/kinfo.c
@@ -138,40 +138,28 @@ KdFreePointer(KdPointerInfo *pi)
{
InputOption *option, *prev = NULL;
- if (pi->name)
- xfree(pi->name);
- if (pi->path)
- xfree(pi->path);
+ xfree(pi->name);
+ xfree(pi->path);
for (option = pi->options; option; option = option->next) {
- if (prev)
- xfree(prev);
- if (option->key)
- xfree(option->key);
- if (option->value)
- xfree(option->value);
+ xfree(prev);
+ xfree(option->key);
+ xfree(option->value);
prev = option;
}
- if (prev)
- xfree(prev);
-
+ xfree(prev);
xfree(pi);
}
void
KdFreeKeyboard(KdKeyboardInfo *ki)
{
- if (ki->name)
- xfree(ki->name);
- if (ki->path)
- xfree(ki->path);
- if (ki->xkbRules)
- xfree(ki->xkbRules);
- if (ki->xkbModel)
- xfree(ki->xkbModel);
- if (ki->xkbLayout)
- xfree(ki->xkbLayout);
+ xfree(ki->name);
+ xfree(ki->path);
+ xfree(ki->xkbRules);
+ xfree(ki->xkbModel);
+ xfree(ki->xkbLayout);
ki->next = NULL;
xfree(ki);
}