From: Antoine Busque Date: Sun, 13 Sep 2015 04:18:44 +0000 (-0400) Subject: Fix: memleak in utils_partial_realpath X-Git-Tag: v2.6.1~12 X-Git-Url: https://git.liburcu.org/?p=lttng-tools.git;a=commitdiff_plain;h=b2c8336a02528a26402d9fc7c5de74b739cf6a37 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 7a09259eb..d4ff94c7a 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -52,7 +52,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 */ @@ -171,6 +171,7 @@ char *utils_partial_realpath(const char *path, char *resolved_path, size_t size) error: free(resolved_path); + free(cut_path); return NULL; }