diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index c8d1de914d0..606fd1debd1 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -343,9 +343,11 @@ static void adv_sent(struct bt_le_ext_adv *instance, BT_DBG("Advertising stopped after %u ms", (uint32_t)duration); atomic_clear_bit(adv->flags, ADV_FLAG_ACTIVE); + atomic_clear_bit(adv->flags, ADV_FLAG_PROXY); - if (!atomic_test_and_clear_bit(adv->flags, ADV_FLAG_PROXY)) { + if (adv->buf) { net_buf_unref(adv->buf); + adv->buf = NULL; } (void)schedule_send(adv);