aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index d1f3f8f..62bf58a 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -517,6 +517,10 @@ int path_store(char **destptr, size_t maxlen, const char *base, const char *path
goto l_path_setup_error;
}
+ if (*destptr) {
+ guard_free(*destptr);
+ }
+
(*destptr) = realpath(path_tmp, NULL);
if (!*destptr) {
goto l_path_setup_error;