From b84880d980d85dc68a1d43fec3ea4f18fd3feeda Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 7 Jan 2008 17:10:07 +0100 Subject: cp (but not copy.c): plug a small leak. * src/cp.c (do_copy) [--parents]: Free the attribute list. --- src/cp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/cp.c b/src/cp.c index be3701fc8..01d98cc64 100644 --- a/src/cp.c +++ b/src/cp.c @@ -683,6 +683,16 @@ do_copy (int n_files, char **file, const char *target_directory, attr_list, x); } + if (parents_option) + { + while (attr_list) + { + struct dir_attr *p = attr_list; + attr_list = attr_list->next; + free (p); + } + } + free (dst_name); } } -- cgit v1.2.3-54-g00ecf