aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-01-15 11:03:00 +0100
committerMax <msuraev@sysmocom.de>2018-01-15 17:23:17 +0100
commit71affcedba7f87183ee2bee99ada7840f2c98a01 (patch)
treed54596accb504a275fa588f4996398552cacc2c0
parent3e659ea9b7308f5032c9b0d4d47841a414303d1d (diff)
Allocate global context for TypesTest
Missing allocation leads to LSAN error: ==24997==ERROR: LeakSanitizer: detected memory leaks Indirect leak of 230 byte(s) in 2 object(s) allocated from: #0 0x7feaa1b2fb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50) #1 0x7feaa13dbc80 in _talloc_zero (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0x5c80) Change-Id: I62c03dad353f459abcdb7a18a69b7782da38dfb7 SUMMARY: AddressSanitizer: 230 byte(s) leaked in 2 allocation(s).
-rw-r--r--tests/types/TypesTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index ff78c87..5c4da22 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -481,6 +481,11 @@ static void test_lsb()
int main(int argc, char **argv)
{
+ tall_pcu_ctx = talloc_named_const(NULL, 1, "types test context");
+ if (!tall_pcu_ctx)
+ abort();
+
+ msgb_talloc_ctx_init(tall_pcu_ctx, 0);
osmo_init_logging(&gprs_log_info);
log_set_use_color(osmo_stderr_target, 0);
log_set_print_filename(osmo_stderr_target, 0);