projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8ce7d35
)
loader: fix a file descriptor leak
author
Blue Swirl
<blauwirbel@gmail.com>
Wed, 12 Jan 2011 19:48:57 +0000
(19:48 +0000)
committer
Blue Swirl
<blauwirbel@gmail.com>
Wed, 12 Jan 2011 19:48:57 +0000
(19:48 +0000)
Fix a file descriptor leak, reported by cppcheck:
[/src/qemu/hw/loader.c:311]: (error) Resource leak: fd
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/loader.c
patch
|
blob
|
history
diff --git
a/hw/loader.c
b/hw/loader.c
index eb198f67239ef6c685f43b79d70bdc078b53ab87..35d792e6477a1aa6ed3319208b35f7be8df34e19 100644
(file)
--- a/
hw/loader.c
+++ b/
hw/loader.c
@@
-307,8
+307,9
@@
int load_elf(const char *filename, uint64_t (*translate_fn)(void *, uint64_t),
target_data_order = ELFDATA2LSB;
}
- if (target_data_order != e_ident[EI_DATA])
- return -1;
+ if (target_data_order != e_ident[EI_DATA]) {
+ goto fail;
+ }
lseek(fd, 0, SEEK_SET);
if (e_ident[EI_CLASS] == ELFCLASS64) {