summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhenhua Zhang <zhenhua.zhang@intel.com>2009-09-23 18:57:17 +0800
committerMarcel Holtmann <marcel@holtmann.org>2009-09-24 10:01:07 -0700
commit78244d6190c837365b8405fef425231d7f698454 (patch)
treece11130b9674dc16551bae98fa95ab2ca72597f9
parentdc644108bfa30d880ba8dd5b1aa80ee544de13b6 (diff)
downloadofono-78244d6190c837365b8405fef425231d7f698454.tar.bz2
Unref GIOChannel in g_at_chat_new_from_tty
-rw-r--r--gatchat/gatchat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
index 5b3a2146..8407338b 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)