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.8.0-rc1~333 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=c14cc49149d98338f8fcd42c360b937f5ddb3990;hp=6f2f1a70002077ebaa604652f08aae017884dfa7 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 2f4ec903a..9fcceab1f 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -124,6 +124,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 */