summaryrefslogtreecommitdiffstats
path: root/lib/backup-files.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/backup-files.c')
-rw-r--r--lib/backup-files.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/backup-files.c b/lib/backup-files.c
index 9f25726..79f3e55 100644
--- a/lib/backup-files.c
+++ b/lib/backup-files.c
@@ -101,10 +101,10 @@ create_parents(const char *filename)
f = strrchr(fn, '/');
if (f == NULL)
- return;
+ goto out;
*f = '\0';
if (stat(fn, &st) == 0)
- return;
+ goto out;
*f = '/';
f = strchr(fn, '/');
@@ -116,6 +116,7 @@ create_parents(const char *filename)
*f = '/';
f = strchr(f+1, '/');
}
+out:
free(fn);
}
@@ -128,7 +129,7 @@ remove_parents(const char *filename)
f = strrchr(fn, '/');
if (f == NULL)
- return;
+ goto out;
do {
*f = '\0';
if (rmdir(fn) == -1)