Diff between c1d4c478c40d659f1b76bb7c38034dc161528e3d and f6dcd1d2bd71ee8c128673241ff5771d364ba732

Changed Files

File Additions Deletions Status
src/shared/bap.c +3 -2 modified

Full Patch

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 6fb449b..672ccf8 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;