Change in libosmocore[master]: osmo-config-merge: Fix asan complaints

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

daniel gerrit-no-reply at lists.osmocom.org
Thu Sep 27 16:57:44 UTC 2018


daniel has uploaded this change for review. ( https://gerrit.osmocom.org/11132


Change subject: osmo-config-merge: Fix asan complaints
......................................................................

osmo-config-merge: Fix asan complaints

Change-Id: I966e63a3f7d0ff71ee0b88922aa3807d073aa232
---
M utils/osmo-config-merge.c
1 file changed, 5 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/11132/1

diff --git a/utils/osmo-config-merge.c b/utils/osmo-config-merge.c
index 3762c67..26d974f 100644
--- a/utils/osmo-config-merge.c
+++ b/utils/osmo-config-merge.c
@@ -49,6 +49,8 @@
 #include <osmocom/core/talloc.h>
 #include <osmocom/core/utils.h>
 
+static void *ctx;
+
 struct node {
 	struct node *parent;		/* back-pointer */
 	struct llist_head list;		/* part of parent->children */
@@ -220,6 +222,7 @@
 static void exit_usage(int rc)
 {
 	fprintf(stderr, "Usage: osmo-config-merge <config-file> <config-patch> [--debug]\n");
+	talloc_free(ctx);
 	exit(rc);
 }
 
@@ -230,7 +233,7 @@
 	struct node *base_tree, *patch_tree;
 	bool debug_enabled = false;
 
-	void *ctx = talloc_named_const(NULL, 0, "root");
+	ctx = talloc_named_const(NULL, 0, "root");
 
 	if (argc < 3)
 		exit_usage(1);
@@ -265,4 +268,5 @@
 	/* make AddressSanitizer / LeakSanitizer happy by recursively freeing the trees */
 	talloc_free(patch_tree);
 	talloc_free(base_tree);
+	talloc_free(ctx);
 }

-- 
To view, visit https://gerrit.osmocom.org/11132
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I966e63a3f7d0ff71ee0b88922aa3807d073aa232
Gerrit-Change-Number: 11132
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180927/ea8f78ac/attachment.htm>


More information about the gerrit-log mailing list