diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-23 11:43:27 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-25 08:17:03 +1000 |
commit | a9c274df5c37cb4ece6449e934342d8ff8e61705 (patch) | |
tree | 4ece210923feed50e6fb63674ed21f2072b55702 /hw/kdrive/src/kinfo.c | |
parent | fd913136732ff14a0484ca28f60ac1fbf49be81d (diff) |
kdrive: plug two memory leaks when freeing the KdKeyboard/Pointer.
xkbRules, xkbModel and xkbLayout are strdup'd in KdNewKeyboard, need to be
freed.
The ephyr driver strdups the name on top of the already allocated
kdrive-assigned name. Memory must be freed beforehand.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw/kdrive/src/kinfo.c')
-rw-r--r-- | hw/kdrive/src/kinfo.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/kdrive/src/kinfo.c b/hw/kdrive/src/kinfo.c index cb646130e..4551fd76b 100644 --- a/hw/kdrive/src/kinfo.c +++ b/hw/kdrive/src/kinfo.c @@ -166,6 +166,12 @@ KdFreeKeyboard(KdKeyboardInfo *ki) 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); ki->next = NULL; xfree(ki); } |