]> git.ipfire.org Git - thirdparty/nftables.git/commit
segtree: Fix memory leaks
authorPhil Sutter <phil@nwl.cc>
Fri, 13 Apr 2018 14:52:27 +0000 (16:52 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 14 Apr 2018 11:53:02 +0000 (13:53 +0200)
commit23a6c8ccdd293a2c3448e5e197cd0384bef767cb
tree03bffc4a95f922a059dbe07d68a93fd13b0b4e46
parent438dddb2146f21c971e552753c7e9488e3c8b193
segtree: Fix memory leaks

This fixes memory leaks in three places:

* set_overlap():

The allocated intervals have to be freed again before returning to
caller. While being at it, reduce indenting level in said function to
stay below 80 columns boundary.

* range_is_prefix():
* interval_map_decompose():

GMP documentation suggests to call mpz_clear() for all mpz_t type
variables once they are not used anymore to free the space they occupy.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/segtree.c