Fix: dereference before null check of channel attributes
[lttng-tools.git] / src / lib / lttng-ctl / lttng-ctl.c
index 469fffa980f33b6c527d94ac47e6fb51a3ce6f42..6bd3f80ec3f8f3a77941d30c67936b98c05efed3 100644 (file)
@@ -2047,14 +2047,14 @@ int lttng_calibrate(struct lttng_handle *handle,
 void lttng_channel_set_default_attr(struct lttng_domain *domain,
                struct lttng_channel_attr *attr)
 {
-       struct lttng_channel_extended *extended =
-                       (struct lttng_channel_extended *) attr->extended.ptr;
+       struct lttng_channel_extended *extended;
 
        /* Safety check */
        if (attr == NULL || domain == NULL) {
                return;
        }
 
+       extended = (struct lttng_channel_extended *) attr->extended.ptr;
        memset(attr, 0, sizeof(struct lttng_channel_attr));
 
        /* Same for all domains. */
This page took 0.023314 seconds and 4 git commands to generate.