summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-10-06 17:51:54 -0300
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-10-06 17:51:54 -0300
commit039a56e77f0d25741c204a6888fcf4d83e9243d6 (patch)
tree1ab07541356978feaaaa8ff318ee4665840daf2f
parent11c5278ced35d333b1c86e10375f0a4607a99a11 (diff)
Fix bug on sco_connect which attempt to close an invalid file descriptor.
-rw-r--r--common/glib-helper.c4
1 files changed, 2 insertions, 2 deletions
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;
}