diff options
| author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-10-06 17:51:54 -0300 | 
|---|---|---|
| committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-10-06 17:51:54 -0300 | 
| commit | 039a56e77f0d25741c204a6888fcf4d83e9243d6 (patch) | |
| tree | 1ab07541356978feaaaa8ff318ee4665840daf2f | |
| parent | 11c5278ced35d333b1c86e10375f0a4607a99a11 (diff) | |
Fix bug on sco_connect which attempt to close an invalid file descriptor.
| -rw-r--r-- | common/glib-helper.c | 4 | 
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;  	} | 
