From a7188cbf48f30782c7dc1ba70bbb93ef8e37dc13 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 15 Dec 2007 11:57:34 -0800 Subject: [PATCH] Fixed a potential memory leak in make_file(). --- flist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.34.1