From 2a3e935f3f652f2b625af72d2c9abda64d742c28 Mon Sep 17 00:00:00 2001 From: Silviu Florian Barbulescu Date: Mon, 15 Jan 2024 00:41:03 +0200 Subject: [PATCH] shared/bap: Fix dereference of null pointer Fix ScanBuild error: Dereference of null pointer --- src/shared/bap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 078d308dc..49eb8d057 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -4763,7 +4763,7 @@ struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap, return NULL; bt_bap_foreach_pac(bap, type, match_pac, &match); - if (!match.lpac) + if ((!match.lpac) || (!lpac)) return NULL; if (!match.rpac && (lpac->type != BT_BAP_BCAST_SOURCE)) return NULL; -- 2.47.3