Fix: Double free in utils_partial_realpath error path
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 18 May 2016 16:17:27 +0000 (12:17 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 20 May 2016 20:39:50 +0000 (16:39 -0400)
Fixes coverity #1355521

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/utils.c

index 25639461cc3ae03e147ff0224364c4db21fb8876..3892cb4ada8b613b2396866e033bf16311abf7a4 100644 (file)
@@ -174,7 +174,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;
 }
 
This page took 0.025781 seconds and 4 git commands to generate.