Fix: move memset in channel_set_attr after NULL check
authorDanny Serres <danny.serres@efficios.com>
Wed, 6 Jun 2012 18:54:30 +0000 (14:54 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 7 Jun 2012 17:02:11 +0000 (13:02 -0400)
Signed-off-by: Danny Serres <danny.serres@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
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.036077 seconds and 4 git commands to generate.