Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
191a03a
)
libext2fs: fix potential memory leak in qcow2_write_raw_image()
author
Theodore Ts'o
<tytso@google.com>
Sun, 5 Jan 2014 06:12:49 +0000
(
01:12
-0500)
committer
Theodore Ts'o
<tytso@mit.edu>
Mon, 6 Jan 2014 03:58:16 +0000
(22:58 -0500)
Addresses-Coverity-ID: #1049179
Addresses-Coverity-ID: #1049180
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/qcow2.c
patch
|
blob
|
history
diff --git
a/lib/ext2fs/qcow2.c
b/lib/ext2fs/qcow2.c
index
547edc0
..
c7cdbee
100644
(file)
--- a/
lib/ext2fs/qcow2.c
+++ b/
lib/ext2fs/qcow2.c
@@
-235,8
+235,10
@@
int qcow2_write_raw_image(int qcow2_fd, int raw_fd,
}
/* Resize the output image to the filesystem size */
- if (ext2fs_llseek(raw_fd, img.image_size - 1, SEEK_SET) < 0)
- return errno;
+ if (ext2fs_llseek(raw_fd, img.image_size - 1, SEEK_SET) < 0) {
+ ret = errno;
+ goto out;
+ }
((char *)copy_buf)[0] = 0;
size = write(raw_fd, copy_buf, 1);