osmo-msc/openbsc/tests/bsc-nat
Holger Hans Peter Freyther 73ec6980d5 nat: Introduce a config free for the test and fix valgrind issues
The talloc_free on the nat lead to the freeing of the bsc_config
which lead to freeing of the rate_ctr_group. The rate_ctr_group
remained in a global list and the next creation of a bsc_config
would access dead memory. Fix it.

The free routine is only meant to be used by the test, for the
real nat we would need to make sure that all connections and
other state that refers to the cfg is removed/closed first.

Fix various memleaks in the test while we are at it. There are
still some to fix.

==7195== Invalid write of size 4
==7195==    at 0x4043171: rate_ctr_group_alloc (linuxlist.h:65)
==7195==    by 0x804D893: bsc_config_alloc (bsc_nat_utils.c:174)
==7195==    by 0x804B5D2: main (bsc_nat_test.c:954)
==7195==  Address 0x4311cbc is 52 bytes inside a block of size 208 free'd
==7195==    at 0x4029D28: free (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==7195==    by 0x4048D98: _talloc_free (talloc.c:609)
==7195==    by 0x4052806: talloc_free (talloc.c:578)
==7195==    by 0x804B58A: main (bsc_nat_test.c:940)
2014-08-29 11:42:34 +02:00
..
Makefile.am move libctrl from openbsc to libosmoctrl (libosmocore.git) 2014-08-21 15:34:28 +02:00
barr.cfg nat: Introduce a global IMSI barr list using red-black trees 2013-01-07 15:02:34 +01:00
barr_dup.cfg nat: Introduce a global IMSI barr list using red-black trees 2013-01-07 15:02:34 +01:00
bsc_data.c mgcp: Add tests for payload types in MGCP messages 2013-12-05 10:27:32 +01:00
bsc_nat_test.c nat: Introduce a config free for the test and fix valgrind issues 2014-08-29 11:42:34 +02:00
bsc_nat_test.ok nat: Extract the LAC/CI from the Complete Layer3 Information 2013-04-16 14:14:17 +02:00
prefixes.csv nat: Implement a post-routing for the NAT software 2013-07-31 16:36:40 +02:00