Fix memory leaks in fio engines

Vitaliy Filippov 2021-01-31 22:47:43 +03:00
parent 9ef7f865b0
commit 21e06ea40d
2 changed files with 4 additions and 4 deletions

View File

@ -93,7 +93,7 @@ static struct fio_option options[] = {
{ {
.name = "cluster_log_level", .name = "cluster_log_level",
.lname = "cluster log level", .lname = "cluster log level",
.type = FIO_OPT_BOOL, .type = FIO_OPT_INT,
.off1 = offsetof(struct sec_options, cluster_log), .off1 = offsetof(struct sec_options, cluster_log),
.help = "Set log level for the Vitastor client", .help = "Set log level for the Vitastor client",
.def = "0", .def = "0",
@ -145,9 +145,7 @@ static void sec_cleanup(struct thread_data *td)
delete bsd->cli; delete bsd->cli;
delete bsd->epmgr; delete bsd->epmgr;
delete bsd->ringloop; delete bsd->ringloop;
bsd->cli = NULL; delete bsd;
bsd->epmgr = NULL;
bsd->ringloop = NULL;
} }
} }

View File

@ -140,6 +140,7 @@ static void sec_cleanup(struct thread_data *td)
if (bsd) if (bsd)
{ {
close(bsd->connect_fd); close(bsd->connect_fd);
delete bsd;
} }
} }
@ -312,6 +313,7 @@ static int sec_getevents(struct thread_data *td, unsigned int min, unsigned int
exit(1); exit(1);
} }
io_u* io = it->second; io_u* io = it->second;
bsd->queue.erase(it);
if (io->ddir == DDIR_READ) if (io->ddir == DDIR_READ)
{ {
if (reply.hdr.retval != io->xfer_buflen) if (reply.hdr.retval != io->xfer_buflen)