Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ret = snprintf(lus->pathname, PATH_MAX, "%s/ust", path);
if (ret < 0) {
PERROR("snprintf kernel traces path");
ret = snprintf(lus->pathname, PATH_MAX, "%s/ust", path);
if (ret < 0) {
PERROR("snprintf kernel traces path");
+ goto error_free_session;
}
DBG2("UST trace session create successful");
return lus;
}
DBG2("UST trace session create successful");
return lus;
+error_free_session:
+ free(lus);
ret = snprintf(luc->pathname, PATH_MAX, "%s", path);
if (ret < 0) {
perror("asprintf ust create channel");
ret = snprintf(luc->pathname, PATH_MAX, "%s", path);
if (ret < 0) {
perror("asprintf ust create channel");
+ goto error_free_channel;
}
DBG2("Trace UST channel %s created", luc->name);
return luc;
}
DBG2("Trace UST channel %s created", luc->name);
return luc;
+error_free_channel:
+ free(luc);
break;
default:
ERR("Unknown ust instrumentation type (%d)", ev->type);
break;
default:
ERR("Unknown ust instrumentation type (%d)", ev->type);
+error_free_event:
+ free(lue);
ret = snprintf(lum->pathname, PATH_MAX, "%s/metadata", path);
if (ret < 0) {
perror("asprintf ust metadata");
ret = snprintf(lum->pathname, PATH_MAX, "%s/metadata", path);
if (ret < 0) {
perror("asprintf ust metadata");
+ goto error_free_metadata;
+error_free_metadata:
+ free(lum);