From: Antoine Busque Date: Wed, 16 Sep 2015 06:58:40 +0000 (-0400) Subject: Fix: prevent dangling pointer in utils_partial_realpath X-Git-Tag: v2.6.1~6 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=ac54ff8c1d44a38e03076a0a02cab47295296f29 Fix: prevent dangling pointer 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 d4ff94c7a..bf6751ebb 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 */