From 16e652aa06fa51e75a8111fb7643ae3d5495437b Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Mon, 12 Dec 2016 16:39:17 -0500 Subject: [PATCH] Fix: free previous instance of url (alloc_url) on default live url assignation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- src/bin/lttng/commands/create.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index 3379a3b27..1603c3003 100644 --- a/src/bin/lttng/commands/create.c +++ b/src/bin/lttng/commands/create.c @@ -342,6 +342,10 @@ static int create_session(void) /* Use default live URL if NO url is/are found. */ if ((opt_live_timer && !opt_url) && (opt_live_timer && !opt_data_url)) { + /* Override the url */ + free(url); + url = NULL; + ret = asprintf(&alloc_url, "net://127.0.0.1"); if (ret < 0) { PERROR("asprintf default live URL"); -- 2.34.1