From 749497eeb3cae13fa2252abcf93468ecd415f063 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 29 Sep 2010 01:19:42 +0800 Subject: nat: Copy the IMSI, then free it or move the context to the connection Extract the IMSI from the first message as well and safe it in the connection structure. The problem is that we do not have this structure at this point, so we will allocate the imsi as child of the bsc_connection and then move/steal it. --- openbsc/tests/bsc-nat/bsc_nat_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'openbsc/tests') diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c index 75bd80384..141775c7a 100644 --- a/openbsc/tests/bsc-nat/bsc_nat_test.c +++ b/openbsc/tests/bsc-nat/bsc_nat_test.c @@ -705,6 +705,7 @@ static void test_cr_filter() nat_entry = bsc_nat_acc_lst_entry_create(nat_lst); for (i = 0; i < ARRAY_SIZE(cr_filter); ++i) { + char *imsi; msgb_reset(msg); copy_to_msg(msg, cr_filter[i].data, cr_filter[i].length); @@ -727,7 +728,7 @@ static void test_cr_filter() abort(); } - res = bsc_nat_filter_sccp_cr(bsc, msg, parsed, &contype); + res = bsc_nat_filter_sccp_cr(bsc, msg, parsed, &contype, &imsi); if (res != cr_filter[i].result) { fprintf(stderr, "FAIL: Wrong result %d for test %d.\n", res, i); abort(); @@ -738,6 +739,7 @@ static void test_cr_filter() abort(); } + talloc_steal(parsed, imsi); talloc_free(parsed); } -- cgit v1.2.3