diff options
Diffstat (limited to 'chardev')
-rw-r--r-- | chardev/char-socket.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 22f65971a1..8401aaed1a 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -592,19 +592,23 @@ static gboolean tcp_chr_telnet_init_io(QIOChannel *ioc, ret = 0; } else { tcp_chr_disconnect(init->chr); - return FALSE; + goto end; } } init->buflen -= ret; if (init->buflen == 0) { tcp_chr_connect(init->chr); - return FALSE; + goto end; } memmove(init->buf, init->buf + ret, init->buflen); - return TRUE; + return G_SOURCE_CONTINUE; + +end: + g_free(init); + return G_SOURCE_REMOVE; } static void tcp_chr_telnet_init(Chardev *chr) |