diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2006-01-25 20:31:46 +0000 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2006-01-25 20:31:46 +0000 |
commit | dbb48909231084dd6e87d3a1e76c3ffcd7c9d6ab (patch) | |
tree | d5579d18482e777347dc9d8ef4f9b974977f5149 /lib/backup-files.c | |
parent | 99e25184f46855b3d9e8bba327d659a031e9d134 (diff) | |
download | quilt-dbb48909231084dd6e87d3a1e76c3ffcd7c9d6ab.tar.gz |
- lib/backup-files.c: Fix memory leaks (markus@oberhumer.com).
Diffstat (limited to 'lib/backup-files.c')
-rw-r--r-- | lib/backup-files.c | 7 |
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) |