summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-03-30 17:40:29 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-03-30 17:40:29 +0000
commitc08ade22068fc1003f1900a6e0989c212bbb5dd6 (patch)
tree0065b57fb8826dbb90163ac1b6b261d04c4c655c
parent6accceac927f8a5451a9cab1ef885d5e0b236432 (diff)
network: fixed GIOChannel close/unref order
-rw-r--r--network/server.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/network/server.c b/network/server.c
index 579e5c06..67319107 100644
--- a/network/server.c
+++ b/network/server.c
@@ -79,10 +79,9 @@ static void pending_auth_free(struct pending_auth *pauth)
return;
if (pauth->addr)
g_free(pauth->addr);
- /* FIXME: Is it necessary close the BNEP socket? */
if (pauth->io) {
- g_io_channel_unref(pauth->io);
g_io_channel_close(pauth->io);
+ g_io_channel_unref(pauth->io);
}
g_free(pauth);
}
@@ -478,9 +477,8 @@ static gboolean connect_event(GIOChannel *chan,
error("Rejecting %s(pending authorization)", peer);
io = g_io_channel_unix_new(nsk);
send_bnep_ctrl_rsp(io, BNEP_CONN_NOT_ALLOWED);
- g_io_channel_unref(io);
g_io_channel_close(io);
- close(nsk);
+ g_io_channel_unref(io);
return TRUE;
}
@@ -724,7 +722,6 @@ static DBusHandlerResult disable(DBusConnection *conn,
}
g_io_channel_unref(ns->io);
- g_io_channel_close(ns->io);
ns->io = NULL;
return send_message_and_unref(conn, reply);
@@ -942,8 +939,8 @@ static void server_free(struct network_server *ns)
dbus_connection_unref(ns->conn);
if (ns->io) {
- g_io_channel_unref(ns->io);
g_io_channel_close(ns->io);
+ g_io_channel_unref(ns->io);
}
g_free(ns);