From: Danny Serres Date: Wed, 6 Jun 2012 18:54:30 +0000 (-0400) Subject: Fix: move memset in channel_set_attr after NULL check X-Git-Tag: v2.1.0-rc1~115 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=eacaa7a62c3f2b9a019fd145d69c977fc53144bb;p=lttng-tools.git Fix: move memset in channel_set_attr after NULL check Signed-off-by: Danny Serres Signed-off-by: David Goulet --- diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 96a54f881..a1256e12d 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -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;