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.11.0-rc4~47 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f127b35fc849f52afdaffc0c0cb83e174d908d7e;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 9f4532cfd..8a884ab6b 100644 --- a/tests/regression/tools/live/live_test.c +++ b/tests/regression/tools/live/live_test.c @@ -693,6 +693,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"); @@ -721,6 +724,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(); }