From: Karel Zak Date: Mon, 9 Oct 2023 11:58:53 +0000 (+0200) Subject: libsmartcols: (filter) cleanup __filter_new_node() X-Git-Tag: v2.40-rc1~151^2~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b2da3f00a480622af5697d54aaa97d2c41c2c20a;p=thirdparty%2Futil-linux.git libsmartcols: (filter) cleanup __filter_new_node() Reported-by: Thomas Weißschuh Signed-off-by: Karel Zak --- 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;