Message ID | 1383779755-18228-8-git-send-email-sandeen@redhat.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
diff --git a/mkfs.c b/mkfs.c index d576797..f29f5cd 100644 --- a/mkfs.c +++ b/mkfs.c @@ -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; }
add_file_items() leaked "buffer" on this error return. Free it first. Resolves-Coverity-CID: 1125937 Signed-off-by: Eric Sandeen <sandeen@redhat.com> --- mkfs.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)