[MERGED] osmo-iuh[master]: fix msgb talloc context initialization

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Oct 13 13:14:48 UTC 2016


Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix msgb talloc context initialization
......................................................................


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
---
M src/hnbgw.c
M src/tests/test-ranap.c
M src/tests/test-ranap.ok
M src/tests/test_common.c
4 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/hnbgw.c b/src/hnbgw.c
index 500cf0f..8d6dbb1 100644
--- a/src/hnbgw.c
+++ b/src/hnbgw.c
@@ -454,6 +454,7 @@
 
 	tall_hnb_ctx = talloc_named_const(NULL, 0, "hnb_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->config.rnc_id = 23;
diff --git a/src/tests/test-ranap.c b/src/tests/test-ranap.c
index c70009b..c1c7003 100644
--- a/src/tests/test-ranap.c
+++ b/src/tests/test-ranap.c
@@ -97,8 +97,6 @@
 
 	//asn_debug = 1;
 
-	msgb_set_talloc_ctx(talloc_named_const(NULL, 1, "msgb"));
-
 	test_common_init();
 
 	test_aper_int(1);
diff --git a/src/tests/test-ranap.ok b/src/tests/test-ranap.ok
index 2ad19e6..bda3c8e 100644
--- a/src/tests/test-ranap.ok
+++ b/src/tests/test-ranap.ok
@@ -214,5 +214,5 @@
 00 0a 00 11 00 00 01 00 29 40 0a 00 00 01 00 28 40 03 05 c2 d0 
 report
 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
diff --git a/src/tests/test_common.c b/src/tests/test_common.c
index 5a37e7e..ba00709 100644
--- a/src/tests/test_common.c
+++ b/src/tests/test_common.c
@@ -78,6 +78,7 @@
 {
 	int rc;
 
+	msgb_talloc_ctx_init(NULL, 0);
 	talloc_asn1_ctx = talloc_named_const(NULL, 0, "asn1_context");
 
 	rc = osmo_init_logging(&test_log_info);

-- 
To view, visit https://gerrit.osmocom.org/1054
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I807c799aff1239184728551ed77fdafa73bd683f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list