Fix: memory leak in sessiond command in error path
authorDavid Goulet <dgoulet@efficios.com>
Tue, 14 May 2013 16:14:35 +0000 (12:14 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 14 May 2013 16:14:35 +0000 (12:14 -0400)
Issue 1019921 of coverity scan.

More leaks were found of the same type also.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/main.c

index 9527371380e02c45011ad60a0f806872e194a861..2cb8f5a23e77b267b37dc513d5dccb8bdc994c40 100644 (file)
@@ -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;
                }
 
This page took 0.027259 seconds and 4 git commands to generate.