X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=doc%2Fexamples%2Frotation%2Frotate-client-example.c;fp=doc%2Fexamples%2Frotation%2Frotate-client-example.c;h=5cb0887bffa88503ca0000a62d6f9d1368fc435a;hp=ae641d895040d9f36acad9fc4a97ac9839ea18e7;hb=878fea902b1c509b61be1f18494edb1f647733b4;hpb=da2475084f73e371756539a5da696d6ec5e187ce diff --git a/doc/examples/rotation/rotate-client-example.c b/doc/examples/rotation/rotate-client-example.c index ae641d895..5cb0887bf 100644 --- a/doc/examples/rotation/rotate-client-example.c +++ b/doc/examples/rotation/rotate-client-example.c @@ -53,7 +53,7 @@ static 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); @@ -90,11 +90,10 @@ static 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; }