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/.
lynxis lazus gerrit-no-reply at lists.osmocom.org
Review at https://gerrit.osmocom.org/1752
tests/bsc & bsc-nat: fix mem leaks of talloc ctx
Found by ASAN.
Change-Id: If1f08df7bcfd1d115824dc1f30577f632bb32615
---
M openbsc/tests/bsc-nat/bsc_nat_test.c
M openbsc/tests/bsc/bsc_test.c
2 files changed, 6 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/52/1752/1
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c
index 2914a01..32a0432 100644
--- a/openbsc/tests/bsc-nat/bsc_nat_test.c
+++ b/openbsc/tests/bsc-nat/bsc_nat_test.c
@@ -1551,7 +1551,8 @@
int main(int argc, char **argv)
{
- msgb_talloc_ctx_init(NULL, 0);
+ void *tctx = talloc_named_const(NULL, 0, "bsc_nat_test");
+ msgb_talloc_ctx_init(tctx, 0);
sccp_set_log_area(DSCCP);
osmo_init_logging(&log_info);
@@ -1572,7 +1573,7 @@
test_mgcp_allocations();
test_barr_list_parsing();
test_nat_extract_lac();
-
+ talloc_free(tctx);
printf("Testing execution completed.\n");
return 0;
}
diff --git a/openbsc/tests/bsc/bsc_test.c b/openbsc/tests/bsc/bsc_test.c
index 7174828..6850b31 100644
--- a/openbsc/tests/bsc/bsc_test.c
+++ b/openbsc/tests/bsc/bsc_test.c
@@ -199,11 +199,12 @@
int main(int argc, char **argv)
{
- msgb_talloc_ctx_init(NULL, 0);
+ void *tctx = talloc_named_const(NULL, 0, "bsc_test");
+ msgb_talloc_ctx_init(tctx, 0);
osmo_init_logging(&log_info);
test_scan();
-
+ talloc_free(tctx);
printf("Testing execution completed.\n");
return 0;
}
--
To view, visit https://gerrit.osmocom.org/1752
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If1f08df7bcfd1d115824dc1f30577f632bb32615
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>