From 494a8e99d905eb46572f011225bef6054aaeaf5f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 16 Sep 2015 21:11:43 -0400 Subject: [PATCH] Clean-up: NULL free'd pointers in utils_partial_realpath MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- src/common/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.34.1