setelem_adjust() checks that EXPR_F_REMOVE is unset already for the previous element. Suggested-by: Phil Sutter <phil@xxxxxx> Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> --- src/intervals.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/intervals.c b/src/intervals.c index cdda9e38ca5e..3f2bb4bca527 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -265,14 +265,12 @@ static void remove_elem(struct expr *prev, struct set *set, struct expr *purge) { struct expr *clone; - if (!(prev->flags & EXPR_F_REMOVE)) { - if (prev->flags & EXPR_F_KERNEL) { - clone = expr_clone(prev); - list_move_tail(&clone->list, &purge->expressions); - } else { - list_del(&prev->list); - expr_free(prev); - } + if (prev->flags & EXPR_F_KERNEL) { + clone = expr_clone(prev); + list_move_tail(&clone->list, &purge->expressions); + } else { + list_del(&prev->list); + expr_free(prev); } } -- 2.30.2