client: Fix a memory leak in an error path
[fio.git] / client.c
index e8f6fd493121d6680df4bac67507b07b0d591fdc..7e5ac17de8f380e411eb2590610d2e01c0e5f34d 100644 (file)
--- a/client.c
+++ b/client.c
@@ -471,8 +471,10 @@ int fio_client_add(struct client_ops *ops, const char *hostname, void **cookie)
                                        &client->is_sock, &client->port,
                                        &client->addr.sin_addr,
                                        &client->addr6.sin6_addr,
-                                       &client->ipv6))
+                                       &client->ipv6)) {
+               fio_put_client(client);
                return -1;
+       }
 
        client->fd = -1;
        client->ops = ops;
@@ -1037,10 +1039,10 @@ static void convert_ts(struct thread_stat *dst, struct thread_stat *src)
        for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                for (j = 0; j < FIO_IO_U_PLAT_NR; j++) {
                        dst->io_u_plat_high_prio[i][j] = le64_to_cpu(src->io_u_plat_high_prio[i][j]);
-                       dst->io_u_plat_prio[i][j] = le64_to_cpu(src->io_u_plat_prio[i][j]);
+                       dst->io_u_plat_low_prio[i][j] = le64_to_cpu(src->io_u_plat_low_prio[i][j]);
                }
                convert_io_stat(&dst->clat_high_prio_stat[i], &src->clat_high_prio_stat[i]);
-               convert_io_stat(&dst->clat_prio_stat[i], &src->clat_prio_stat[i]);
+               convert_io_stat(&dst->clat_low_prio_stat[i], &src->clat_low_prio_stat[i]);
        }
 
        dst->ss_dur             = le64_to_cpu(src->ss_dur);