From e56ddcada4ca5deabaf45224e0911da9dd25f1f0 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 18 May 2016 12:17:27 -0400 Subject: [PATCH] Fix: Double free in utils_partial_realpath error path MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes coverity #1355521 Signed-off-by: Michael Jeanson 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 bbe13ed7d..217d8c65d 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -177,7 +177,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.34.1