Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddfa8e18 authored by Matthew Xie's avatar Matthew Xie Committed by Android (Google) Code Review
Browse files

Merge "Close the base socket when bindListen fails" into lmp-dev

parents 1f0ce338 726652e9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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;
        }