From 78244d6190c837365b8405fef425231d7f698454 Mon Sep 17 00:00:00 2001 From: Zhenhua Zhang Date: Wed, 23 Sep 2009 18:57:17 +0800 Subject: [PATCH] Unref GIOChannel in g_at_chat_new_from_tty --- gatchat/gatchat.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c index 5b3a214..8407338 100644 --- a/gatchat/gatchat.c +++ b/gatchat/gatchat.c @@ -984,6 +984,7 @@ GAtChat *g_at_chat_new_from_tty(const char *device, GAtSyntax *syntax) { GIOChannel *channel; int fd; + GAtChat *chat; fd = open_device(device); if (fd < 0) @@ -995,7 +996,9 @@ GAtChat *g_at_chat_new_from_tty(const char *device, GAtSyntax *syntax) return NULL; } - return g_at_chat_new(channel, syntax); + chat = g_at_chat_new(channel, syntax); + g_io_channel_unref(channel); + return chat; } GAtChat *g_at_chat_ref(GAtChat *chat) -- 2.7.4