diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/copy.c | 4 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2007-11-28 Paul Eggert <eggert@cs.ucla.edu> + + Close a file descriptor leak when cp --preserve=context fails. + * src/copy.c (copy_reg): Close dest_desc too, if getfscreatecon + or fsetfilecon fail. + 2007-11-28 Jim Meyering <meyering@redhat.com> * README: Document the known problem with gettext <= 0.17. diff --git a/src/copy.c b/src/copy.c index 4dec5166e..975890750 100644 --- a/src/copy.c +++ b/src/copy.c @@ -341,7 +341,7 @@ copy_reg (char const *src_name, char const *dst_name, if (x->require_preserve_context) { return_val = false; - goto close_src_desc; + goto close_src_and_dst_desc; } } @@ -356,7 +356,7 @@ copy_reg (char const *src_name, char const *dst_name, { return_val = false; freecon (con); - goto close_src_desc; + goto close_src_and_dst_desc; } } freecon(con); |