diff options
author | Zhenhua Zhang <zhenhua.zhang@intel.com> | 2010-06-12 13:50:44 +0800 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-06-17 14:54:42 -0500 |
commit | 199582f684acd6eea082343aa5ffeb4614754279 (patch) | |
tree | 4ce29cc169e64649c004d7a0e3ce5a8af819f953 /gatchat/test-server.c | |
parent | 1822deba4ad820faa6bbfeb7760383ccc0cf31d1 (diff) |
test-server: Fix GIOChannel leak in create_tty
Remove client_io and unref server_io after creating GAtServer.
Diffstat (limited to 'gatchat/test-server.c')
-rw-r--r-- | gatchat/test-server.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gatchat/test-server.c b/gatchat/test-server.c index 74ddd4d5..5c1cfa4a 100644 --- a/gatchat/test-server.c +++ b/gatchat/test-server.c @@ -722,7 +722,6 @@ static gboolean create_tty(const char *modem_path) int master, slave; char pty_name[256]; GIOChannel *server_io; - GIOChannel *client_io; if (!modem_path) return FALSE; @@ -732,9 +731,6 @@ static gboolean create_tty(const char *modem_path) set_raw_mode(slave); - client_io = g_io_channel_unix_new(slave); - g_io_channel_set_close_on_unref(client_io, TRUE); - g_print("new pty is created at %s\n", pty_name); server_io = g_io_channel_unix_new(master); @@ -747,6 +743,8 @@ static gboolean create_tty(const char *modem_path) return FALSE; } + g_io_channel_unref(server_io); + return TRUE; } |