From 5bd340eb5a176af428847949268869d71de8802c Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 16 Apr 2018 00:57:10 +0200 Subject: use osmo_init_logging2(), fix regression test memleaks Particularly gbproxy_test.c had various mem leaks, which (will) show up with gcc (Debian 7.3.0-15) 7.3.0 address sanitizer. Fix those leaks to verify that we don't have memleaks in the production code. Change-Id: Ia4204c8b3d895b42c103edecb61b99d3d22bd36f --- tests/slhc/slhc_test.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/slhc') diff --git a/tests/slhc/slhc_test.c b/tests/slhc/slhc_test.c index bb0e26cb8..5c1331355 100644 --- a/tests/slhc/slhc_test.c +++ b/tests/slhc/slhc_test.c @@ -250,17 +250,20 @@ static struct log_info info = { int main(int argc, char **argv) { void *ctx; - - osmo_init_logging(&info); + void *log_ctx; ctx = talloc_named_const(NULL, 0, "slhc_ctx"); + log_ctx = talloc_named_const(ctx, 0, "log"); + osmo_init_logging2(log_ctx, &info); test_slhc(ctx); printf("Done\n"); talloc_report_full(ctx, stderr); + talloc_free(log_ctx); OSMO_ASSERT(talloc_total_blocks(ctx) == 1); + talloc_free(ctx); return 0; } -- cgit v1.2.3