From 039a56e77f0d25741c204a6888fcf4d83e9243d6 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 6 Oct 2008 17:51:54 -0300 Subject: Fix bug on sco_connect which attempt to close an invalid file descriptor. --- common/glib-helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/glib-helper.c b/common/glib-helper.c index c05ac5c5..93e9c27a 100644 --- a/common/glib-helper.c +++ b/common/glib-helper.c @@ -775,7 +775,7 @@ static BtIOError sco_connect(BtIO *io, BtIOFunc func) { struct io_context *io_ctxt = io->io_ctxt; struct sockaddr_sco addr; - int sk, err; + int err; io_ctxt->func = func; @@ -790,7 +790,7 @@ static BtIOError sco_connect(BtIO *io, BtIOFunc func) err = transport_connect(io, (struct sockaddr *) &addr, sizeof(addr)); if (err < 0) { - close(sk); + close(io_ctxt->fd); return BT_IO_FAILED; } -- cgit