X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=doc%2Fexamples%2Frotation%2Frotate-client-example.c;h=34287e8bb6e0f2a38ceb64a959d445bfc0e16b07;hb=a41134074c65a36cd818e22a99493b0be8199f36;hp=a9d8b9f311a7edbbb1a94c642075134724a1d83c;hpb=bb96c32c361c1e265068eb017d267a020dda61bb;p=lttng-tools.git diff --git a/doc/examples/rotation/rotate-client-example.c b/doc/examples/rotation/rotate-client-example.c index a9d8b9f31..34287e8bb 100644 --- a/doc/examples/rotation/rotate-client-example.c +++ b/doc/examples/rotation/rotate-client-example.c @@ -61,7 +61,7 @@ int setup_session(const char *session_name, const char *path) int ret; struct lttng_domain dom; struct lttng_event ev; - struct lttng_handle *chan_handle; + struct lttng_handle *chan_handle = NULL; printf("Creating session %s\n", session_name); ret = lttng_create_session(session_name, path); @@ -98,11 +98,10 @@ int setup_session(const char *session_name, const char *path) goto end; } - lttng_destroy_handle(chan_handle); - ret = 0; end: + lttng_destroy_handle(chan_handle); return ret; }