projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
27ca949
)
Fix leak of file descriptor in error path of bc_calc()
author
Jens Axboe
<axboe@fb.com>
Fri, 11 Apr 2014 17:27:34 +0000
(11:27 -0600)
committer
Jens Axboe
<axboe@fb.com>
Fri, 11 Apr 2014 17:27:34 +0000
(11:27 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
options.c
patch
|
blob
|
blame
|
history
diff --git
a/options.c
b/options.c
index 5c372b6964c0eb078737732131cbbb63c7541f10..9096a322bbc089db652662f8a1b04defd3f228b3 100644
(file)
--- a/
options.c
+++ b/
options.c
@@
-3656,8
+3656,10
@@
static char *bc_calc(char *str)
return NULL;
ret = fread(&buf[tmp - str], 1, 128 - (tmp - str), f);
- if (ret <= 0)
+ if (ret <= 0) {
+ pclose(f);
return NULL;
+ }
pclose(f);
buf[(tmp - str) + ret - 1] = '\0';