--- src/shared/bap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index a866f4cdc..96fca595b 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -6910,14 +6910,15 @@ static void add_new_subgroup(struct bt_base *base, struct bt_bap_stream *stream) { struct bt_bap_pac *lpac = stream->lpac; - struct bt_subgroup *sgrp = new0( - struct bt_subgroup, 1); + struct bt_subgroup *sgrp; uint16_t cid = 0; uint16_t vid = 0; if (!lpac) return; + sgrp = new0(struct bt_subgroup, 1); + bt_bap_pac_get_vendor_codec(lpac, &sgrp->codec.id, &cid, &vid, NULL, NULL); sgrp->codec.cid = cid; -- 2.34.1