projects
/
platform
/
upstream
/
btrfs-progs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0650c12
)
btrfs-progs: don't leak buffer on add_file_items() error
author
Eric Sandeen
<sandeen@redhat.com>
Wed, 6 Nov 2013 23:15:46 +0000
(17:15 -0600)
committer
Chris Mason
<chris.mason@fusionio.com>
Thu, 7 Nov 2013 21:10:41 +0000
(16:10 -0500)
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>
mkfs.c
patch
|
blob
|
history
diff --git
a/mkfs.c
b/mkfs.c
index
46ee5c0
..
bf8a831
100644
(file)
--- 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;
}