projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
blktrace: Fix memory leaks in error paths
[fio.git]
/
blktrace.c
diff --git
a/blktrace.c
b/blktrace.c
index 2c2b5aebbc7fcc179182e1d4578dbe7d1c7e5d00..64a610a95944c9ec1e5d4fdaba56b987e24c7943 100644
(file)
--- a/
blktrace.c
+++ b/
blktrace.c
@@
-733,6
+733,7
@@
int merge_blktrace_iologs(struct thread_data *td)
if (bcs[i].fd < 0) {
log_err("fio: could not open file: %s\n", name);
ret = bcs[i].fd;
if (bcs[i].fd < 0) {
log_err("fio: could not open file: %s\n", name);
ret = bcs[i].fd;
+ free(str);
goto err_file;
}
bcs[i].fifo = fifo_alloc(TRACE_FIFO_SIZE);
goto err_file;
}
bcs[i].fifo = fifo_alloc(TRACE_FIFO_SIZE);
@@
-740,11
+741,13
@@
int merge_blktrace_iologs(struct thread_data *td)
if (!is_blktrace(name, &bcs[i].swap)) {
log_err("fio: file is not a blktrace: %s\n", name);
if (!is_blktrace(name, &bcs[i].swap)) {
log_err("fio: file is not a blktrace: %s\n", name);
+ free(str);
goto err_file;
}
ret = read_trace(td, &bcs[i]);
if (ret < 0) {
goto err_file;
}
ret = read_trace(td, &bcs[i]);
if (ret < 0) {
+ free(str);
goto err_file;
} else if (!ret) {
merge_finish_file(bcs, i, &nr_logs);
goto err_file;
} else if (!ret) {
merge_finish_file(bcs, i, &nr_logs);