Fix: move memset in channel_set_attr after NULL check
[lttng-tools.git] / src / lib / lttng-ctl / lttng-ctl.c
index 36069ef2816b7906bb9f19a8c0714912a8061f31..356fb34c416097d553c05ed727a92691b169eef3 100644 (file)
@@ -885,13 +885,13 @@ int lttng_calibrate(struct lttng_handle *handle,
 void lttng_channel_set_default_attr(struct lttng_domain *domain,
                struct lttng_channel_attr *attr)
 {
-       memset(attr, 0, sizeof(struct lttng_channel_attr));
-
        /* Safety check */
        if (attr == NULL || domain == NULL) {
                return;
        }
 
+       memset(attr, 0, sizeof(struct lttng_channel_attr));
+
        switch (domain->type) {
        case LTTNG_DOMAIN_KERNEL:
                attr->overwrite = DEFAULT_CHANNEL_OVERWRITE;
This page took 0.023261 seconds and 4 git commands to generate.