]> git.tue.mpg.de Git - paraslash.git/commitdiff
filter_common: Annotate possible NULL pointer confusion.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 13 May 2024 21:25:08 +0000 (23:25 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 26 May 2024 16:12:45 +0000 (18:12 +0200)
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

index f48e457005ca3510fb51d5e5f95405af15d927c1..c1576752f6e4ddcbfd1b5357c3992df26a0c24ca 100644 (file)
@@ -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: