From d2745d6dbac0486aac74e3258c6a8d2b0bc520fc Mon Sep 17 00:00:00 2001 From: Mariusz Skamra Date: Wed, 13 Dec 2023 12:56:52 +0100 Subject: [PATCH] tests: Bluetooth: shell: Fix connection reference leak This fixes regression introduced in recently. Redundant connection reference is taken twice in connected() callback. The redunant reference was then not returned, and as a result we had a leak. Signed-off-by: Mariusz Skamra --- subsys/bluetooth/shell/bt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/subsys/bluetooth/shell/bt.c b/subsys/bluetooth/shell/bt.c index 79647ead4ef..da8c5abec5a 100644 --- a/subsys/bluetooth/shell/bt.c +++ b/subsys/bluetooth/shell/bt.c @@ -694,8 +694,6 @@ static void connected(struct bt_conn *conn, uint8_t err) } } - default_conn = bt_conn_ref(conn); - done: /* clear connection reference for sec mode 3 pairing */ if (pairing_conn) {