Merge branch 'pcpp_epoch_fixing_2' of https://github.com/PCPartPicker/fio
[fio.git] / engines / io_uring.c
index 7ac7c755b2813c179efbee0202d771def5ba6ea4..6cdf1b4fe4a12342f198b021cd9f6e3740c5aab4 100644 (file)
@@ -1165,10 +1165,13 @@ static int fio_ioring_init(struct thread_data *td)
                        md_size += td->o.mem_align - page_size;
                if (td->o.mem_type == MEM_MALLOC) {
                        ld->md_buf = malloc(md_size);
-                       if (!ld->md_buf)
+                       if (!ld->md_buf) {
+                               free(ld);
                                return 1;
+                       }
                } else {
                        log_err("fio: Only iomem=malloc or mem=malloc is supported\n");
+                       free(ld);
                        return 1;
                }
        }