summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
76da29b)
Use strdup to copy a string instead of using the formatting utilities.
The code of the function is also adapted to follow the coding standards.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I13328737e42a0287a7402761f75c67eef0dbdfdd
*/
int lttng_set_tracing_group(const char *name)
{
*/
int lttng_set_tracing_group(const char *name)
{
- return -LTTNG_ERR_INVALID;
+ ret = -LTTNG_ERR_INVALID;
+ goto end;
- if (asprintf(&new_group, "%s", name) < 0) {
- return -LTTNG_ERR_FATAL;
+ new_group = strdup(name);
+ if (!new_group) {
+ ret = -LTTNG_ERR_FATAL;
+ goto end;
}
free(tracing_group);
tracing_group = new_group;
new_group = NULL;
}
free(tracing_group);
tracing_group = new_group;
new_group = NULL;
}
int lttng_calibrate(struct lttng_handle *handle,
}
int lttng_calibrate(struct lttng_handle *handle,