summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/socket.c b/lib/socket.c
index a347f78..d0bd152 100644
--- a/lib/socket.c
+++ b/lib/socket.c
@@ -2006,7 +2006,7 @@ uc_socket_addrinfo(uc_vm_t *vm, size_t nargs)
return NULL;
}
- servstr = (ucv_type(serv) != UC_STRING) ? ucv_to_string(vm, serv) : NULL;
+ servstr = (serv && ucv_type(serv) != UC_STRING) ? ucv_to_string(vm, serv) : NULL;
ret = getaddrinfo(ucv_string_get(host),
servstr ? servstr : ucv_string_get(serv),
ai_hints, &ai_res);