From ae9c20bc3d88d014d850b9e9b7df6b0f1e7ff894 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 14 May 2013 12:14:35 -0400 Subject: [PATCH] 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 --- src/bin/lttng-sessiond/main.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.34.1