X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fcommon%2Futils.c;h=25639461cc3ae03e147ff0224364c4db21fb8876;hb=ef4a79b97e84065a8384ab5d628fbf8365cf9bba;hp=d4ff94c7a09680308516e9cd6301b6ce8003844d;hpb=b2c8336a02528a26402d9fc7c5de74b739cf6a37;p=lttng-tools.git diff --git a/src/common/utils.c b/src/common/utils.c index d4ff94c7a..25639461c 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -121,6 +121,7 @@ char *utils_partial_realpath(const char *path, char *resolved_path, size_t size) /* Free the allocated memory */ free(cut_path); + cut_path = NULL; }; /* Allocate memory for the resolved path if necessary */ @@ -172,6 +173,8 @@ char *utils_partial_realpath(const char *path, char *resolved_path, size_t size) error: free(resolved_path); free(cut_path); + free(try_path); + free(try_path_prev); return NULL; }