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 d479b9c..9b53127 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;
             }