diff options
author | pfg <pfg@FreeBSD.org> | 2015-04-23 14:53:45 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2015-04-23 14:53:45 +0000 |
commit | 5d86d5b050f72d396528bcabd3e725855c805ac3 (patch) | |
tree | 98c7163f86a6f56abc33f81c936b8cb89b8d78a4 | |
parent | c8f92b825ab526f4b25b051a72a875c46bb319aa (diff) | |
download | FreeBSD-src-5d86d5b050f72d396528bcabd3e725855c805ac3.zip FreeBSD-src-5d86d5b050f72d396528bcabd3e725855c805ac3.tar.gz |
Plug memory leaks in kbdmux(4)
Al kudos here for the Clang static analyzer which, unlike Coverity,
failed to flag a false positive.
Found by: clang static analyzer
CID: 1007072
CID: 1007073
CID: 1007074
MFC after: 1 week
-rw-r--r-- | sys/dev/kbdmux/kbdmux.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c index a21b37c..8632ad3 100644 --- a/sys/dev/kbdmux/kbdmux.c +++ b/sys/dev/kbdmux/kbdmux.c @@ -472,6 +472,11 @@ kbdmux_init(int unit, keyboard_t **kbdp, void *arg, int flags) KBDMUX_UNLOCK(state); } + if (needfree) { + free(accmap, M_KBDMUX); + free(fkeymap, M_KBDMUX); + free(keymap, M_KBDMUX); + } return (0); bad: if (needfree) { |