`alloc_path` merely contains the contents of `default_path`.
The allocation of `alloc_path` can be removed and `default_path`
used in its place.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
{
int ret;
char *traces_path = NULL;
{
int ret;
char *traces_path = NULL;
- char *alloc_path = NULL;
char *default_path;
default_path = utils_get_home_dir();
char *default_path;
default_path = utils_get_home_dir();
Please specify an output path using -o, --output PATH");
goto exit;
}
Please specify an output path using -o, --output PATH");
goto exit;
}
- alloc_path = strdup(default_path);
- if (alloc_path == NULL) {
- PERROR("Path allocation");
- goto exit;
- }
ret = asprintf(&traces_path, "%s/" DEFAULT_TRACE_DIR_NAME
ret = asprintf(&traces_path, "%s/" DEFAULT_TRACE_DIR_NAME
- "/%s", alloc_path, path_name);
+ "/%s", default_path, path_name);
if (ret < 0) {
PERROR("asprintf trace dir name");
goto exit;
}
exit:
if (ret < 0) {
PERROR("asprintf trace dir name");
goto exit;
}
exit: