From: David Goulet Date: Wed, 16 Oct 2013 19:42:52 +0000 (-0400) Subject: Fix: memory leak in error path in JUL list X-Git-Tag: v2.4.0-rc1~88 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=aae6255e116d17f57e5a2eaf477bf48939a2121a;p=lttng-tools.git Fix: memory leak in error path in JUL list Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/jul.c b/src/bin/lttng-sessiond/jul.c index 4f2250dff..318d51165 100644 --- a/src/bin/lttng-sessiond/jul.c +++ b/src/bin/lttng-sessiond/jul.c @@ -414,7 +414,7 @@ int jul_list_events(struct lttng_event **events) int ret; size_t nbmem, count = 0; struct jul_app *app; - struct lttng_event *tmp_events; + struct lttng_event *tmp_events = NULL; struct lttng_ht_iter iter; assert(events); @@ -466,8 +466,10 @@ int jul_list_events(struct lttng_event **events) ret = count; *events = tmp_events; + return ret; error: + free(tmp_events); return ret; }