Fix: leaking string by setting pointer to NULL before freeing it
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 28 Aug 2018 20:12:40 +0000 (16:12 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 29 Aug 2018 21:32:45 +0000 (17:32 -0400)
Reported-by: Coverity (1395200) Resource leak
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/utils.c

index 84d42f4638e53f37fc139c4b1c6d5d6b1c30b375..78bfbef95ede423f4a6c028fbfb0a3886e3c0ea8 100644 (file)
@@ -337,7 +337,6 @@ char *_utils_expand_path(const char *path, bool keep_symlink)
                char *cwd_ret;
                cwd_ret = getcwd(current_working_dir, sizeof(current_working_dir));
                if (!cwd_ret) {
-                       absolute_path = NULL;
                        goto error;
                }
                /*
This page took 0.024865 seconds and 4 git commands to generate.