nftnl_expr_alloc already ran ->init(expr) and ->parse may have allocating sub-objects in the data[] region, those allocations leak. Example is dynset.c: parser might have allocated the set_name, then encountered a pars error when handling the embedded expressions. Signed-off-by: Florian Westphal --- src/expr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expr.c b/src/expr.c index 0fec358e7480..6462119e3eb2 100644 --- a/src/expr.c +++ b/src/expr.c @@ -284,7 +284,7 @@ struct nftnl_expr *nftnl_expr_parse(struct nlattr *attr) return expr; err2: - xfree(expr); + nftnl_expr_free(expr); err1: return NULL; } -- 2.55.0