summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--serial/manager.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/serial/manager.c b/serial/manager.c
index ec06ac0e..ba9ef112 100644
--- a/serial/manager.c
+++ b/serial/manager.c
@@ -449,6 +449,8 @@ static int rfcomm_connect(struct pending_connect *pc)
if (!(errno == EAGAIN || errno == EINPROGRESS)) {
error("connect() failed: %s (%d)",
strerror(errno), errno);
+ g_io_channel_unref(pc->io);
+ pc->io = NULL;
goto fail;
}