From 9482daac152865fcc4c2609ce89a2de473abc138 Mon Sep 17 00:00:00 2001 From: Antoine Busque Date: Sun, 13 Sep 2015 00:18:44 -0400 Subject: [PATCH] Fix: memleak in utils_partial_realpath MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Antoine Busque Signed-off-by: Jérémie Galarneau --- src/common/utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.34.1