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.7.0-rc2~18 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7565586a9441b2c3eb5dbc323e78933e0cebbdd5;p=lttng-tools.git 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 */