X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommon%2Futils.c;h=2f4ec903a2f9b849f1d0c32121400dfda5368844;hb=9482daac152865fcc4c2609ce89a2de473abc138;hp=337713eb78ab39493bb745c994d7d43df9400d0f;hpb=7591bab11eceedc6a0d1e02fd6f85592267a63b5;p=lttng-tools.git diff --git a/src/common/utils.c b/src/common/utils.c index 337713eb7..2f4ec903a 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -55,7 +55,7 @@ LTTNG_HIDDEN char *utils_partial_realpath(const char *path, char *resolved_path, size_t size) { - char *cut_path, *try_path = NULL, *try_path_prev = NULL; + char *cut_path = NULL, *try_path = NULL, *try_path_prev = NULL; const char *next, *prev, *end; /* Safety net */ @@ -174,6 +174,7 @@ char *utils_partial_realpath(const char *path, char *resolved_path, size_t size) error: free(resolved_path); + free(cut_path); return NULL; } @@ -763,10 +764,6 @@ int utils_unlink_stream_file(const char *path_name, char *file_name, uint64_t si ret = unlink(path); } else { ret = run_as_unlink(path, uid, gid); - if (ret < 0) { - errno = -ret; - ret = -1; - } } if (ret < 0) { goto error;