diff --git a/src/client.c b/src/client.c

index 34d25f3794f8069b15a688ebd89b7bf82fdd01e2..d8b67d7b9f47b4473ba6eb278853ea0565739f09 100644

--- a/src/client.c

+++ b/src/client.c

@@ -59,7 +59,7 @@ {

struct addrinfo *addr;

enum gemini_result res = gemini_get_addrinfo(uri, options, resp, &addr);

if (res != GEMINI_OK) {

- goto cleanup;

+ return res;

}

struct addrinfo *rp;

@@ -79,7 +79,6 @@ res = GEMINI_ERR_CONNECT;

return res;

}

-cleanup:

if (!options || !options->addr) {

freeaddrinfo(addr);

}