From f6dcd1d2bd71ee8c128673241ff5771d364ba732 Mon Sep 17 00:00:00 2001 From: Ismagil Iskakov Date: Tue, 8 Jul 2025 14:09:05 +0300 Subject: [PATCH] shared/bap: fix memleak --- 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 6fb449b60..672ccf853 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -7016,14 +7016,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.47.3