From b1d41407438e92d79fa17cde7f6da0cc559386f9 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Fri, 26 Oct 2012 12:32:42 -0400 Subject: [PATCH] Fix: Memory leaks of allocated URIs Signed-off-by: David Goulet --- src/bin/lttng-sessiond/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index b5a98432f..41cdf1126 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -2553,12 +2553,14 @@ skip_domain: DBG("No URIs received from client... continuing"); *sock_error = 1; ret = LTTNG_ERR_SESSION_FAIL; + free(uris); goto error; } ret = cmd_set_consumer_uri(cmd_ctx->lsm->domain.type, cmd_ctx->session, nb_uri, uris); if (ret != LTTNG_OK) { + free(uris); goto error; } @@ -2579,6 +2581,8 @@ skip_domain: } } + free(uris); + break; } case LTTNG_START_TRACE: @@ -2613,12 +2617,14 @@ skip_domain: DBG("No URIs received from client... continuing"); *sock_error = 1; ret = LTTNG_ERR_SESSION_FAIL; + free(uris); goto error; } if (nb_uri == 1 && uris[0].dtype != LTTNG_DST_PATH) { DBG("Creating session with ONE network URI is a bad call"); ret = LTTNG_ERR_SESSION_FAIL; + free(uris); goto error; } } @@ -2626,6 +2632,8 @@ skip_domain: ret = cmd_create_session_uri(cmd_ctx->lsm->session.name, uris, nb_uri, &cmd_ctx->creds); + free(uris); + break; } case LTTNG_DESTROY_SESSION: -- 2.34.1