[lttng-dev] [PATCH lttng-tools] Fix: Double free in utils_partial_realpath error path

Michael Jeanson mjeanson at efficios.com
Wed May 18 16:17:27 UTC 2016


Fixes coverity #1355521

Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 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 30a5f10..901ddb0 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -190,7 +190,9 @@ error:
 	free(resolved_path);
 	free(cut_path);
 	free(try_path);
-	free(try_path_prev);
+	if (try_path_prev != try_path) {
+		free(try_path_prev);
+	}
 	return NULL;
 }
 
-- 
2.7.4



More information about the lttng-dev mailing list