From: Jérémie Galarneau Date: Thu, 12 Sep 2019 14:12:41 +0000 (-0400) Subject: Tests: fix: uninitialized session_id used on list_sessions failure X-Git-Tag: v2.10.8~9 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b57207709dcd64dfab6186f83961aba20898c529;p=lttng-tools.git Tests: fix: uninitialized session_id used on list_sessions failure Stop live test when list_sessions() fails since the session_id used further on would be uninitialized. Signed-off-by: Jérémie Galarneau --- diff --git a/tests/regression/tools/live/live_test.c b/tests/regression/tools/live/live_test.c index 8ff97db25..c44d05b0c 100644 --- a/tests/regression/tools/live/live_test.c +++ b/tests/regression/tools/live/live_test.c @@ -694,6 +694,9 @@ int main(int argc, char **argv) ret = list_sessions(&session_id); ok(ret > 0, "List sessions : %d session(s)", ret); + if (ret < 0) { + goto end; + } ret = create_viewer_session(); ok(ret == 0, "Create viewer session"); @@ -722,6 +725,6 @@ int main(int argc, char **argv) ret = attach_session(session_id); ok(ret > 0, "Attach to session, %d streams received", ret); - +end: return exit_status(); }