fix msgb talloc context initialization

Properly initialize msgb talloc context in hnbgw and all tests, using the new
msgb_talloc_ctx_init().

test-ranap.c: since msgb talloc ctx is now in test_common_init(), remove msgb
talloc init here.

Change-Id: I807c799aff1239184728551ed77fdafa73bd683f
This commit is contained in:
Neels Hofmeyr 2016-09-16 01:38:46 +02:00
parent f7f17d4b8f
commit 4ff1a5a957
4 changed files with 3 additions and 3 deletions

View File

@ -454,6 +454,7 @@ int main(int argc, char **argv)
tall_hnb_ctx = talloc_named_const(NULL, 0, "hnb_context"); tall_hnb_ctx = talloc_named_const(NULL, 0, "hnb_context");
talloc_asn1_ctx = talloc_named_const(NULL, 0, "asn1_context"); talloc_asn1_ctx = talloc_named_const(NULL, 0, "asn1_context");
msgb_talloc_ctx_init(tall_hnb_ctx, 0);
g_hnb_gw = hnb_gw_create(tall_hnb_ctx); g_hnb_gw = hnb_gw_create(tall_hnb_ctx);
g_hnb_gw->config.rnc_id = 23; g_hnb_gw->config.rnc_id = 23;

View File

@ -97,8 +97,6 @@ int main(int argc, char **argv)
//asn_debug = 1; //asn_debug = 1;
msgb_set_talloc_ctx(talloc_named_const(NULL, 1, "msgb"));
test_common_init(); test_common_init();
test_aper_int(1); test_aper_int(1);

View File

@ -214,5 +214,5 @@ Decoded Cause Misc=115
00 0a 00 11 00 00 01 00 29 40 0a 00 00 01 00 28 40 03 05 c2 d0 00 0a 00 11 00 00 01 00 29 40 0a 00 00 01 00 28 40 03 05 c2 d0
report report
talloc report on 'asn1_context' (total 0 bytes in 1 blocks) talloc report on 'asn1_context' (total 0 bytes in 1 blocks)
talloc report on 'msgb' (total 1 bytes in 1 blocks) talloc report on 'msgb' (total 0 bytes in 1 blocks)
exit exit

View File

@ -78,6 +78,7 @@ int test_common_init(void)
{ {
int rc; int rc;
msgb_talloc_ctx_init(NULL, 0);
talloc_asn1_ctx = talloc_named_const(NULL, 0, "asn1_context"); talloc_asn1_ctx = talloc_named_const(NULL, 0, "asn1_context");
rc = osmo_init_logging(&test_log_info); rc = osmo_init_logging(&test_log_info);