summaryrefslogtreecommitdiffstats
path: root/src/segtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/segtree.c')
-rw-r--r--src/segtree.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/segtree.c b/src/segtree.c
index 9aa39e52..ad199355 100644
--- a/src/segtree.c
+++ b/src/segtree.c
@@ -210,6 +210,12 @@ static int ei_insert(struct list_head *msgs, struct seg_tree *tree,
ei = lei;
goto err;
}
+ /* single element contained in an existing interval */
+ if (mpz_cmp(new->left, new->right) == 0) {
+ ei_destroy(new);
+ goto out;
+ }
+
/*
* The new interval is entirely contained in the same interval,
* split it into two parts:
@@ -277,7 +283,7 @@ static int ei_insert(struct list_head *msgs, struct seg_tree *tree,
}
__ei_insert(tree, new);
-
+out:
mpz_clear(p);
return 0;