Fix memleak in disconnect()