Clean-up: NULL free'd pointers in utils_partial_realpath
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 17 Sep 2015 01:11:43 +0000 (21:11 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 17 Sep 2015 01:11:43 +0000 (21:11 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/utils.c

index 9fcceab1f3149c2c5e17a3e68d4ee1b60fc4932c..3c9e70ddad6439ee362d9187c751151eca60d32a 100644 (file)
@@ -125,7 +125,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 */
        if (resolved_path == NULL) {
@@ -162,6 +162,8 @@ char *utils_partial_realpath(const char *path, char *resolved_path, size_t size)
                /* Free the allocated memory */
                free(cut_path);
                free(try_path_prev);
+               cut_path = NULL;
+               try_path_prev = NULL;
        /*
         * Else, we just copy the path in our resolved_path to
         * return it as is
This page took 0.028178 seconds and 4 git commands to generate.