Fix tests: NULL pointer dereference in ltt_ust_context unit tests
[lttng-tools.git] / tests / unit / test_ust_data.c
index cea322d32ddaf3a8f6bd07eb695772653758266a..61e2c3c6e54c558d650b7260120b1d6e8ab51eb4 100644 (file)
@@ -277,8 +277,12 @@ static void test_create_ust_context(void)
        uctx = trace_ust_create_context(&ectx);
        ok(uctx != NULL, "Create UST context");
 
-       ok((int) uctx->ctx.ctx == LTTNG_UST_CONTEXT_VTID,
-          "Validate UST context");
+       if (uctx) {
+               ok((int) uctx->ctx.ctx == LTTNG_UST_CONTEXT_VTID,
+                  "Validate UST context");
+       } else {
+               skip(1, "Skipping UST context validation as creation failed");
+       }
        free(uctx);
 }
 
This page took 0.023514 seconds and 5 git commands to generate.