From: Andre Noll Date: Mon, 13 May 2024 21:25:08 +0000 (+0200) Subject: filter_common: Annotate possible NULL pointer confusion. X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=05a0de6800ab6dc66a62bffaf3a137b4fd192b4b;p=paraslash.git 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. --- 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: