bluetooth: host: Unref conn on direct adv start error

Unref conn when direct adv start exits with an error.

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
This commit is contained in:
Pawel Dunaj 2019-04-17 17:40:23 +02:00 committed by Carles Cufí
commit 56a2691e1c

View file

@ -2043,6 +2043,7 @@ struct bt_conn *bt_conn_create_slave_le(const bt_addr_le_t *peer,
if (err && (err != -EALREADY)) {
BT_WARN("Directed advertising could not be"
" started: %d", err);
bt_conn_unref(conn);
return NULL;
}