From 05a0de6800ab6dc66a62bffaf3a137b4fd192b4b Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 13 May 2024 23:25:08 +0200 Subject: [PATCH] filter_common: Annotate possible NULL pointer confusion. We know at this point that filter_num is good, so filter_get() returns non-NULL. But gcc-13's static analyzer does not see this and warns. The added assertion makes the warning go away and tells the reader that f == NULL is impossible here. --- filter_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/filter_common.c b/filter_common.c index f48e4570..c1576752 100644 --- a/filter_common.c +++ b/filter_common.c @@ -99,6 +99,7 @@ int filter_setup(const char *fa, void **conf, struct lls_parse_result **lprp) if (ret < 0) goto free_argv; f = filter_get(filter_num); + assert(f); *conf = f->setup? f->setup(*lprp) : NULL; ret = filter_num; free_argv: -- 2.39.5