[lttng-dev] [PATCH lttng-tools v2] Fix: free previous instance of url (alloc_url) on default live url assignation

Jonathan Rajotte jonathan.rajotte-julien at efficios.com
Mon Dec 12 21:39:17 UTC 2016


Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
---
 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 0f7d1a4..40d2a77 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.7.4



More information about the lttng-dev mailing list