X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Flist.c;h=6040d008d09a7b5f55f06dfdb05f7eb42981bf53;hp=7c33046ebec1490f798ca4a63e71f0778f91c1db;hb=ef021732eab101776844ec263468004e287fe6e2;hpb=65b1b1983d46c85ee8754c24c108a0df79a60559 diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 7c33046eb..6040d008d 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -260,6 +260,7 @@ static int list_ust_events(void) size = lttng_list_tracepoints(handle, &event_list); if (size < 0) { ERR("Unable to list UST events"); + lttng_destroy_handle(handle); return size; } @@ -280,10 +281,12 @@ static int list_ust_events(void) MSG(""); free(event_list); + lttng_destroy_handle(handle); return CMD_SUCCESS; error: + lttng_destroy_handle(handle); return -1; } @@ -311,6 +314,7 @@ static int list_kernel_events(void) size = lttng_list_tracepoints(handle, &event_list); if (size < 0) { ERR("Unable to list kernel events"); + lttng_destroy_handle(handle); return size; } @@ -324,9 +328,11 @@ static int list_kernel_events(void) free(event_list); + lttng_destroy_handle(handle); return CMD_SUCCESS; error: + lttng_destroy_handle(handle); return -1; }