btrfs-progs: don't leak buffer on add_file_items() error

add_file_items() leaked "buffer" on this error return.
Free it first.

Resolves-Coverity-CID: 1125937
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
Eric Sandeen 2013-11-06 17:15:46 -06:00 committed by Chris Mason
parent 0650c12576
commit 249b93b5ef
1 changed files with 1 additions and 0 deletions

1
mkfs.c
View File

@ -629,6 +629,7 @@ static int add_file_items(struct btrfs_trans_handle *trans,
ret_read = pread64(fd, buffer, st->st_size, bytes_read);
if (ret_read == -1) {
fprintf(stderr, "%s read failed\n", path_name);
free(buffer);
goto end;
}