projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d824f3
)
Fix leak on error path in extend_file()
author
Jens Axboe
<axboe@fb.com>
Fri, 11 Apr 2014 17:28:54 +0000
(11:28 -0600)
committer
Jens Axboe
<axboe@fb.com>
Fri, 11 Apr 2014 17:28:54 +0000
(11:28 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
filesetup.c
patch
|
blob
|
blame
|
history
diff --git
a/filesetup.c
b/filesetup.c
index 6d46ca3c5e1e33caa028960296e450c1757711e6..bf56112b72b9784cf32583ebc0dbba72324b9f86 100644
(file)
--- a/
filesetup.c
+++ b/
filesetup.c
@@
-38,7
+38,7
@@
static int extend_file(struct thread_data *td, struct fio_file *f)
int r, new_layout = 0, unlink_file = 0, flags;
unsigned long long left;
unsigned int bs;
- char *b;
+ char *b
= NULL
;
if (read_only) {
log_err("fio: refusing extend of file due to read-only\n");
@@
-189,6
+189,8
@@
done:
err:
close(f->fd);
f->fd = -1;
+ if (b)
+ free(b);
return 1;
}