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, 12 Sep 2019 14:12:41 +0000 (10:12 -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 9f4532cfd6078c71e6e4ad0e3a547cb570ccf872..8a884ab6bf68d3b5d8cbc04cfcbfdcf609f70388 100644 (file)
@@ -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();
 }
This page took 0.034685 seconds and 4 git commands to generate.