From: Jérémie Galarneau Date: Thu, 17 Sep 2015 01:11:43 +0000 (-0400) Subject: Clean-up: NULL free'd pointers in utils_partial_realpath X-Git-Tag: v2.8.0-rc1~332 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=494a8e99d905eb46572f011225bef6054aaeaf5f;p=lttng-tools.git Clean-up: NULL free'd pointers in utils_partial_realpath Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/utils.c b/src/common/utils.c index 9fcceab1f..3c9e70dda 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -125,7 +125,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 */ if (resolved_path == NULL) { @@ -162,6 +162,8 @@ char *utils_partial_realpath(const char *path, char *resolved_path, size_t size) /* Free the allocated memory */ free(cut_path); free(try_path_prev); + cut_path = NULL; + try_path_prev = NULL; /* * Else, we just copy the path in our resolved_path to * return it as is