From: David Goulet Date: Fri, 26 Oct 2012 16:32:42 +0000 (-0400) Subject: Fix: Memory leaks of allocated URIs X-Git-Tag: v2.1.0-rc6~15 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b1d41407438e92d79fa17cde7f6da0cc559386f9;p=lttng-tools.git Fix: Memory leaks of allocated URIs Signed-off-by: David Goulet --- 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: