The check for the expected context's type must be skipped when
trace_ust_create_context() fails. Otherwise, a NULL pointer
dereference will occur.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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);
}