summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2018-10-03 12:16:40 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-10-03 12:19:35 +0200
commite08c8bbfeda80f3807ce3784558ce1fb6f0d2bc8 (patch)
tree286d64dfcd3c7e376fd81a9662f09ad065a2fd90 /src
parent33eb4594a1c764776a46b48bc1a7d726b561359d (diff)
segtree: memleak in get_set_decompose()
Release set content on error. Moreover, release input set content in case we finally manage to decompose it. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/segtree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/segtree.c b/src/segtree.c
index 0d53c83f..dc2554b7 100644
--- a/src/segtree.c
+++ b/src/segtree.c
@@ -727,6 +727,7 @@ int get_set_decompose(struct table *table, struct set *set)
range = get_set_interval_find(table, set->handle.set.name,
left, i);
if (!range) {
+ expr_free(new_init);
errno = ENOENT;
return -1;
}
@@ -755,6 +756,7 @@ int get_set_decompose(struct table *table, struct set *set)
compound_expr_add(new_init, expr_clone(left));
}
+ expr_free(set->init);
set->init = new_init;
return 0;