summaryrefslogtreecommitdiff
path: root/flist.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2007-12-15 11:57:34 -0800
committerWayne Davison <wayned@samba.org>2007-12-15 11:57:34 -0800
commita7188cbf48f30782c7dc1ba70bbb93ef8e37dc13 (patch)
tree3759eaa1ca02613ef8057aa58e24bfc24868e176 /flist.c
parentf7a2ac075f267d4cba779c26e20147d25d047e4e (diff)
downloadrsync-a7188cbf48f30782c7dc1ba70bbb93ef8e37dc13.tar.gz
Fixed a potential memory leak in make_file().
Diffstat (limited to 'flist.c')
-rw-r--r--flist.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/flist.c b/flist.c
index 732c2420..cc7a873d 100644
--- a/flist.c
+++ b/flist.c
@@ -1231,8 +1231,11 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
file->mode = save_mode;
}
- if (basename_len == 0+1)
+ if (basename_len == 0+1) {
+ if (!pool)
+ unmake_file(file);
return NULL;
+ }
if (unsort_ndx)
F_NDX(file) = dir_count;