projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cedf9a6
)
vvfat: fix a file descriptor leak
author
Blue Swirl
<blauwirbel@gmail.com>
Wed, 12 Jan 2011 19:48:58 +0000
(19:48 +0000)
committer
Blue Swirl
<blauwirbel@gmail.com>
Wed, 12 Jan 2011 19:48:58 +0000
(19:48 +0000)
Fix a file descriptor leak, reported by cppcheck:
[/src/qemu/block/vvfat.c:759]: (error) Resource leak: dir
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
block/vvfat.c
patch
|
blob
|
history
diff --git
a/block/vvfat.c
b/block/vvfat.c
index 26dd474bb5bdf3f086948750b8d40284e4bf3f0a..fe568fe2c7548556a202cb33b7e0c1c4243396fa 100644
(file)
--- a/
block/vvfat.c
+++ b/
block/vvfat.c
@@
-756,6
+756,7
@@
static int read_directory(BDRVVVFATState* s, int mapping_index)
if (st.st_size > 0x7fffffff) {
fprintf(stderr, "File %s is larger than 2GB\n", buffer);
free(buffer);
+ closedir(dir);
return -2;
}
direntry->size=cpu_to_le32(S_ISDIR(st.st_mode)?0:st.st_size);