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:01:38 +0000 (13:01 -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 96a54f881c8e5df2b9225bed57997be0c4339cda..a1256e12d981aa5da93c7aed8f7784e24732be9b 100644 (file)
@@ -912,13 +912,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.026624 seconds and 4 git commands to generate.