diff options
author | Ziye Yang <ziye.yang@intel.com> | 2019-10-29 22:35:38 +0800 |
---|---|---|
committer | Ziye Yang <ziye.yang@intel.com> | 2019-10-29 22:37:38 +0800 |
commit | ab43b8cb08d2152e3f15544f8dfd49d7e3e975cc (patch) | |
tree | e902d1832d8bcfbc7524479cde594c31edd125c2 | |
parent | c656b9056e45f9acd1d374a85c5becf7cc6a00ca (diff) | |
download | fio-ab43b8cb08d2152e3f15544f8dfd49d7e3e975cc.tar.gz fio-ab43b8cb08d2152e3f15544f8dfd49d7e3e975cc.tar.bz2 |
backend: fix the memory leak if fio_memalign fails,
We should not use break, we should use return 1 and explictly fails this,
then the cleanup routine will work. If not, this function may still
return 0.
Signed-off-by: Gang Cao <cao.gang@intel.com>
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
-rw-r--r-- | backend.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1236,7 +1236,7 @@ static int init_io_u(struct thread_data *td) ptr = fio_memalign(cl_align, sizeof(*io_u), td_offload_overlap(td)); if (!ptr) { log_err("fio: unable to allocate aligned memory\n"); - break; + return 1; } io_u = ptr; |