From: David Goulet Date: Tue, 14 May 2013 16:14:35 +0000 (-0400) Subject: Fix: memory leak in sessiond command in error path X-Git-Tag: v2.2.0-rc3~75 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ae9c20bc3d88d014d850b9e9b7df6b0f1e7ff894;p=lttng-tools.git Fix: memory leak in sessiond command in error path Issue 1019921 of coverity scan. More leaks were found of the same type also. Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 952737138..2cb8f5a23 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -2895,6 +2895,7 @@ skip_domain: ret = setup_lttng_msg(cmd_ctx, nb_dom * sizeof(struct lttng_domain)); if (ret < 0) { + free(domains); goto setup_error; } @@ -2922,6 +2923,7 @@ skip_domain: ret = setup_lttng_msg(cmd_ctx, nb_chan * sizeof(struct lttng_channel)); if (ret < 0) { + free(channels); goto setup_error; } @@ -2949,6 +2951,7 @@ skip_domain: ret = setup_lttng_msg(cmd_ctx, nb_event * sizeof(struct lttng_event)); if (ret < 0) { + free(events); goto setup_error; }