X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=lttng%2Futils.c;h=2cb77568e339433062408f8c69a8f3fac072fd98;hp=109532a4f60da1d94cf11ec5b907fc49ea68d2ca;hb=58a97671d5fa65f93126798ded9e5306e3555186;hpb=3087ef18ecb79a3fcef9c8bb8a3e9dc1ea228ff0 diff --git a/lttng/utils.c b/lttng/utils.c index 109532a4f..2cb77568e 100644 --- a/lttng/utils.c +++ b/lttng/utils.c @@ -22,33 +22,6 @@ #include "conf.h" -/* - * get_config_file_path - * - * Return absolute path to the configuration file. - */ -char *get_config_file_path(void) -{ - char *alloc_path, *path = NULL; - - /* Get path to config directory */ - alloc_path = config_get_default_path(); - if (alloc_path == NULL) { - goto error; - } - - /* Get path to config file */ - path = config_generate_dir_path(alloc_path); - if (path == NULL) { - goto free_alloc_path; - } - -free_alloc_path: - free(alloc_path); -error: - return path; -} - /* * get_session_name * @@ -60,7 +33,7 @@ char *get_session_name(void) char *path, *session_name = NULL; /* Get path to config file */ - path = get_config_file_path(); + path = config_get_default_path(); if (path == NULL) { goto error; } @@ -68,11 +41,9 @@ char *get_session_name(void) /* Get session name from config */ session_name = config_read_session_name(path); if (session_name == NULL) { - goto free_path; + goto error; } -free_path: - free(path); error: return session_name; }