Fix memleak in set element and hash expressions destroy path.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
{
xfree(expr->comment);
expr_free(expr->key);
+ stmt_free(expr->stmt);
}
static void set_elem_expr_clone(struct expr *new, const struct expr *expr)
new->hash.type = expr->hash.type;
}
+static void hash_expr_destroy(struct expr *expr)
+{
+ expr_free(expr->hash.expr);
+}
+
const struct expr_ops hash_expr_ops = {
.type = EXPR_HASH,
.name = "hash",
.json = hash_expr_json,
.cmp = hash_expr_cmp,
.clone = hash_expr_clone,
+ .destroy = hash_expr_destroy,
};
struct expr *hash_expr_alloc(const struct location *loc,