Fix tests: NULL pointer dereference in ltt_ust_context unit tests
[lttng-tools.git] / tests / unit / test_ust_data.c
index 43ad3115bcd4ae6a4a52616f4b2deefb89a429ce..f22f8c4e21fdfcf3db85e9f6a3c8aec161d9cdb3 100644 (file)
@@ -252,8 +252,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.023718 seconds and 4 git commands to generate.