diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2007-11-29 08:32:54 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2007-11-29 08:32:54 +0100 |
commit | 9962f24cc458e7d7588d4d043339823067aa3b83 (patch) | |
tree | 5ee8e507d0bda051d1e92640b7b1f386f58f5e1d /src | |
parent | 4352534a0cb9f48fc47f98e048265087a6cd9dba (diff) | |
download | coreutils-9962f24cc458e7d7588d4d043339823067aa3b83.tar.xz |
Close a file descriptor leak when cp --preserve=context fails.
* src/copy.c (copy_reg): Close dest_desc too, if getfscreatecon
or fsetfilecon fail.
Diffstat (limited to 'src')
-rw-r--r-- | src/copy.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |