fix memleak
fix disconnect segv
fix zombies
Merge wiechu/ekg2
Revert "fix null pointer dereference (another)"

This reverts commit 8880cf7ddf04d7803a9e2e2bf60bc762981da885. Wiesław
Ochmiński fixed this in d422c0df0e98b845305200ee532e928d68ac0af8.
Revert "fix null pointer dereference"

This reverts commit 7e091f3a390f56024dc49cef4fa9ce5b764f3db7.