]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
cp (but not copy.c): plug a small leak.
authorJim Meyering <meyering@redhat.com>
Mon, 7 Jan 2008 16:10:07 +0000 (17:10 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 7 Jan 2008 16:10:07 +0000 (17:10 +0100)
* src/cp.c (do_copy) [--parents]: Free the attribute list.

ChangeLog
src/cp.c

index c03c0d1593b99094587d6dc0c0a4153508499dad..0018fdcf4977b1dbe08b5585bf9b9f7a9919785f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-01-07  Jim Meyering  <meyering@redhat.com>
 
+       cp (but not copy.c): plug a small leak.
+       * src/cp.c (do_copy) [--parents]: Free the attribute list.
+
        Make a racy test failure less likely to happen.
        * tests/misc/tty-eof: Uncomment a debug "warn".
        This change happens to make this test far less likely to fail.
index be3701fc8c18aa876328acde8eb4cbb039bc67f6..01d98cc6472d19876fb531e9f38f827fca193725 100644 (file)
--- 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);
        }
     }