Fix tests: NULL pointer dereference in ltt_session unit tests
[lttng-tools.git] / tests / unit / test_session.c
index 991b1dca3de4e71d69d038bab9469bbef402af6c..cdb1bb88d7046cbe46218324db8031deddde00d1 100644 (file)
@@ -269,9 +269,13 @@ void test_destroy_session(void)
        ok(tmp != NULL,
           "Destroying session: session found");
 
-       ok(destroy_one_session(tmp) == 0,
-          "Destroying session: %s destroyed",
-          SESSION1);
+       if (tmp) {
+               ok(destroy_one_session(tmp) == 0,
+                  "Destroying session: %s destroyed",
+                  SESSION1);
+       } else {
+               skip(1, "Skipping session destruction as it was not found");
+       }
        session_unlock_list();
 }
 
This page took 0.031389 seconds and 4 git commands to generate.