]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libsmartcols: (filter) cleanup __filter_new_node()
authorKarel Zak <kzak@redhat.com>
Mon, 9 Oct 2023 11:58:53 +0000 (13:58 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 20 Nov 2023 21:25:47 +0000 (22:25 +0100)
Reported-by: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols/src/filter.c

index ef28e6fde47d0cbe479060be27c15ff42f162317..1fbbb573898c2422441d9f502ad0674d7573680b 100644 (file)
@@ -80,10 +80,9 @@ void scols_unref_filter(struct libscols_filter *fltr)
  * functions (e.g. filter_new_param() */
 struct filter_node *__filter_new_node(enum filter_ntype type, size_t sz)
 {
-       void *x = calloc(1, sz);
-       struct filter_node *n = (struct filter_node *) x;
+       struct filter_node *n = calloc(1, sz);
 
-       if (!x)
+       if (!n)
                return NULL;
 
        n->type = type;