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>
Wed, 18 May 2016 19:33:29 +0000 (15:33 -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 30a5f106ba8b19ec6ebbf26a059ff20fd278062c..901ddb036771d77ff7ab1c2f723c98db7f895bbb 100644 (file)
@@ -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;
 }
 
This page took 0.026119 seconds and 4 git commands to generate.