diff options
Diffstat (limited to 'lib/socket.c')
-rw-r--r-- | lib/socket.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/socket.c b/lib/socket.c index d0bd152..159f81c 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -2228,8 +2228,11 @@ uc_socket_connect(uc_vm_t *vm, size_t nargs) uc_vector_grow(&addresses); ap = &addresses.entries[addresses.count++]; - if (!uv_to_sockaddr(host, &ap->ss, &ap->ai.ai_addrlen)) + if (!uv_to_sockaddr(host, &ap->ss, &ap->ai.ai_addrlen)) { + free(ai_hints); + uc_vector_clear(&addresses); return NULL; + } if (serv) { uint64_t port = ucv_to_unsigned(serv); |