Change in osmo-iuh[master]: Workaround ASan report memleak during call to --vty-ref-xml

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/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Feb 23 19:06:37 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-iuh/+/23070 )

Change subject: Workaround ASan report memleak during call to --vty-ref-xml
......................................................................

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
---
M src/hnbgw.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



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 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);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/23070
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I383653c981e68a053babd33dee1f0df8731752b0
Gerrit-Change-Number: 23070
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210223/2e3f19e2/attachment.htm>


More information about the gerrit-log mailing list