From f274c01bde0e88ee7aa86f0197ad59b125930ad4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 21 Jan 2007 18:57:15 +0000 Subject: Fix cleanup in case the SDP server startup fails --- sdpd/server.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sdpd/server.c') diff --git a/sdpd/server.c b/sdpd/server.c index 6e632237..3f29bbef 100644 --- a/sdpd/server.c +++ b/sdpd/server.c @@ -47,7 +47,7 @@ #include "logging.h" #include "sdpd.h" -static GIOChannel *l2cap_io, *unix_io; +static GIOChannel *l2cap_io = NULL, *unix_io = NULL; static int l2cap_sock, unix_sock; @@ -237,8 +237,7 @@ int start_sdp_server(uint16_t mtu, uint32_t flags) g_io_channel_set_close_on_unref(unix_io, TRUE); g_io_add_watch(unix_io, G_IO_IN, io_accept_event, &unix_sock); - } else - unix_io = NULL; + } return 0; } @@ -252,5 +251,6 @@ void stop_sdp_server(void) if (unix_io) g_io_channel_unref(unix_io); - g_io_channel_unref(l2cap_io); + if (l2cap_io) + g_io_channel_unref(l2cap_io); } -- cgit