Tests: fix: uninitialized session_id used on list_sessions failure
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 12 Sep 2019 14:12:41 +0000 (10:12 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 26 Sep 2019 19:29:51 +0000 (15:29 -0400)
Stop live test when list_sessions() fails since the session_id used
further on would be uninitialized.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/tools/live/live_test.c

index 8ff97db253652dad50e5f3d08816bba689b7288f..c44d05b0c91bbcecbbec2e9ddc65d929b9992cae 100644 (file)
@@ -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();
 }
This page took 0.026001 seconds and 4 git commands to generate.