OSDN Git Service
(root)
/
android-x86
/
external-efivar.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1132479
)
efi_loadopt_args_from_file(): fix leaked file descriptor.
author
Peter Jones
<pjones@redhat.com>
Mon, 1 May 2017 18:40:26 +0000
(14:40 -0400)
committer
Peter Jones
<pjones@redhat.com>
Mon, 1 May 2017 20:00:33 +0000
(16:00 -0400)
In the case where we're just trying to figure out the file's size, we're
failing to close the file. So close it.
Found by covscan.
Signed-off-by: Peter Jones <pjones@redhat.com>
src/loadopt.c
patch
|
blob
|
history
diff --git
a/src/loadopt.c
b/src/loadopt.c
index
ce88986
..
a3c1ba9
100644
(file)
--- a/
src/loadopt.c
+++ b/
src/loadopt.c
@@
-275,8
+275,10
@@
efi_loadopt_args_from_file(uint8_t *buf, ssize_t size, char *filename)
if (rc < 0)
goto err;
- if (size == 0)
+ if (size == 0) {
+ fclose(f);
return statbuf.st_size;
+ }
if (size < statbuf.st_size) {
errno = ENOSPC;