Close the base socket when bindListen fails
Bug: 10773872 Change-Id: I0a72b2eb65055fa1959070d2dc32d40a573bd6f2
This commit is contained in:
committed by
Andre Eisenbach
parent
a42c0de977
commit
726652e9d3
@@ -375,6 +375,14 @@ public final class BluetoothSocket implements Closeable {
|
||||
} // else ASSERT(mPort == channel)
|
||||
ret = 0;
|
||||
} catch (IOException e) {
|
||||
if (mPfd != null) {
|
||||
try {
|
||||
mPfd.close();
|
||||
} catch (IOException e1) {
|
||||
Log.e(TAG, "bindListen, close mPfd: " + e1);
|
||||
}
|
||||
mPfd = null;
|
||||
}
|
||||
Log.e(TAG, "bindListen, fail to get port number, exception: " + e);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user