int wpipe, bool internal_event)
{
int ret, channel_created = 0;
- struct lttng_channel *attr;
+ struct lttng_channel *attr = NULL;
assert(session);
assert(event);
if (lttng_strncpy(attr->name, channel_name,
sizeof(attr->name))) {
ret = LTTNG_ERR_INVALID;
- free(attr);
goto error;
}
ret = cmd_enable_channel(session, domain, attr, wpipe);
if (ret != LTTNG_OK) {
- free(attr);
goto error;
}
- free(attr);
-
channel_created = 1;
}
if (lttng_strncpy(attr->name, channel_name,
sizeof(attr->name))) {
ret = LTTNG_ERR_INVALID;
- free(attr);
goto error;
}
ret = cmd_enable_channel(session, domain, attr, wpipe);
if (ret != LTTNG_OK) {
- free(attr);
goto error;
}
- free(attr);
/* Get the newly created channel reference back */
uchan = trace_ust_find_channel_by_name(
free(filter_expression);
free(filter);
free(exclusion);
+ free(attr);
rcu_read_unlock();
return ret;
}