From: Antoine Busque Date: Sun, 13 Sep 2015 04:18:44 +0000 (-0400) Subject: Fix: memleak in utils_partial_realpath X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=9482daac152865fcc4c2609ce89a2de473abc138 Fix: memleak in utils_partial_realpath Signed-off-by: Antoine Busque Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/utils.c b/src/common/utils.c index d7811bd7a..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; }