]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
copy: fix an unlikely memory leak when a fiemap copy fails
authorPádraig Brady <P@draigBrady.com>
Tue, 5 Apr 2011 18:16:40 +0000 (19:16 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 6 Apr 2011 22:08:54 +0000 (23:08 +0100)
* src/copy.c (extent_copy): Free the extents array when
sparse_copy() fails.

src/copy.c

index d479b9c8f57d240737632f0d8c885f142121af7b..9b53127c4556fd7a8341d4660b012804f08abef1 100644 (file)
@@ -415,7 +415,7 @@ extent_copy (int src_fd, int dest_fd, char *buf, size_t buf_size,
                                   sparse_mode == SPARSE_ALWAYS,
                                   src_name, dst_name, ext_len, &n_read,
                                   &wrote_hole_at_eof))
-                return false;
+                goto fail;
 
               dest_pos = ext_start + n_read;
             }