From ff8c223440829e3c2dde99ca0cc9ae037f28e725 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 23 Feb 2021 19:51:53 +0100 Subject: Workaround ASan report memleak during call to --vty-ref-xml For some unknown reason, using size=0 instead of 1 makes LeakSanitizer report a leak when calling osmo-hnbgw --vty-ref-xml: """ ==19857==ERROR: LeakSanitizer: detected memory leaks Direct leak of 96 byte(s) in 1 object(s) allocated from: #0 0x7f083b4d0d28 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1d28) #1 0x7f083a8e5661 in talloc_named_const (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0x6661) """ It seems iu_client.c is already using size=1. Change-Id: I383653c981e68a053babd33dee1f0df8731752b0 --- src/hnbgw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/hnbgw.c b/src/hnbgw.c index e21ec4a..965e8a4 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -576,7 +576,7 @@ int main(int argc, char **argv) int rc; tall_hnb_ctx = talloc_named_const(NULL, 0, "hnb_context"); - talloc_asn1_ctx = talloc_named_const(NULL, 0, "asn1_context"); + talloc_asn1_ctx = talloc_named_const(NULL, 1, "asn1_context"); msgb_talloc_ctx_init(tall_hnb_ctx, 0); g_hnb_gw = hnb_gw_create(tall_hnb_ctx); -- cgit v1.2.3