Change in openbsc[master]: legacy_mgcp: mgcp_test: sanitize: free msgb_ctx

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Aug 20 20:21:12 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10552 )

Change subject: legacy_mgcp: mgcp_test: sanitize: free msgb_ctx
......................................................................

legacy_mgcp: mgcp_test: sanitize: free msgb_ctx

Ensure that all msgb were cleaned up, then free the overall msgb_ctx, in order
to not leave any memory leaks the sanitizer build complains about.

Backport from osmo-mgw.git

Change-Id: I84e0ac7f0928f04ffddd7da18200466841589c25
---
M openbsc/tests/mgcp/mgcp_test.c
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/openbsc/tests/mgcp/mgcp_test.c b/openbsc/tests/mgcp/mgcp_test.c
index 154d0f3..92099db 100644
--- a/openbsc/tests/mgcp/mgcp_test.c
+++ b/openbsc/tests/mgcp/mgcp_test.c
@@ -1208,7 +1208,7 @@
 
 int main(int argc, char **argv)
 {
-	msgb_talloc_ctx_init(NULL, 0);
+	void *msgb_ctx = msgb_talloc_ctx_init(NULL, 0);
 	osmo_init_logging(&log_info);
 
 	test_strline();
@@ -1227,6 +1227,9 @@
 	test_no_name();
 	test_osmux_cid();
 
+	OSMO_ASSERT(talloc_total_size(msgb_ctx) == 0);
+	OSMO_ASSERT(talloc_total_blocks(msgb_ctx) == 1);
+	talloc_free(msgb_ctx);
 	printf("Done\n");
 	return EXIT_SUCCESS;
 }

-- 
To view, visit https://gerrit.osmocom.org/10552
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I84e0ac7f0928f04ffddd7da18200466841589c25
Gerrit-Change-Number: 10552
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180820/60e1f65f/attachment.htm>


More information about the gerrit-log mailing list