diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-11-18 21:26:26 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-08-20 17:54:19 +0200 |
commit | 775eea233133157e7b0dc77fb6257052e7f147a3 (patch) | |
tree | b2d592940742a8f95c78c27b5a5d4d812204328e /openbsc/tests | |
parent | 96b8a0328b32ab5388a06b8a64f74d50a03a3d9a (diff) |
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
Diffstat (limited to 'openbsc/tests')
-rw-r--r-- | openbsc/tests/mgcp/mgcp_test.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/openbsc/tests/mgcp/mgcp_test.c b/openbsc/tests/mgcp/mgcp_test.c index 154d0f308..92099dbee 100644 --- a/openbsc/tests/mgcp/mgcp_test.c +++ b/openbsc/tests/mgcp/mgcp_test.c @@ -1208,7 +1208,7 @@ static void test_osmux_cid(void) 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 @@ int main(int argc, char **argv) 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; } |