X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=client.c;h=29d8750a5b2b6948bc8206399d6a1be774a22a78;hb=d7c7539faf5f1c23962590f80b40dafe2d232207;hp=84fc1f531009e39bae4ac5852b6a2eb32e247b9b;hpb=6c424d93e52538ffad36dbf6f544b4ad9c441fb4;p=fio.git diff --git a/client.c b/client.c index 84fc1f53..29d8750a 100644 --- a/client.c +++ b/client.c @@ -390,8 +390,6 @@ struct fio_client *fio_client_add_explicit(struct client_ops *ops, client = get_new_client(); - client->hostname = strdup(hostname); - if (type == Fio_client_socket) client->is_sock = true; else { @@ -410,6 +408,7 @@ struct fio_client *fio_client_add_explicit(struct client_ops *ops, client->ops = ops; client->refs = 1; client->type = ops->client_type; + client->hostname = strdup(hostname); __fio_client_add_cmd_option(client, "fio"); @@ -471,8 +470,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;