From b2da3f00a480622af5697d54aaa97d2c41c2c20a Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 9 Oct 2023 13:58:53 +0200 Subject: [PATCH] libsmartcols: (filter) cleanup __filter_new_node() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported-by: Thomas Weißschuh Signed-off-by: Karel Zak --- libsmartcols/src/filter.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libsmartcols/src/filter.c b/libsmartcols/src/filter.c index ef28e6fde4..1fbbb57389 100644 --- a/libsmartcols/src/filter.c +++ b/libsmartcols/src/filter.c @@ -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; -- 2.47.3