summaryrefslogtreecommitdiffstats
path: root/whois.c
diff options
context:
space:
mode:
Diffstat (limited to 'whois.c')
-rw-r--r--whois.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/whois.c b/whois.c
index 18a4b5c..1afe313 100644
--- a/whois.c
+++ b/whois.c
@@ -347,7 +347,7 @@ int handle_query(const char *hserver, const char *hport,
sockfd = openconn(server + 1, NULL);
free(server);
server = query_crsnic(sockfd, query);
- if (no_recursion)
+ if (no_recursion && server)
server[0] = '\0';
break;
case 8:
@@ -356,7 +356,7 @@ int handle_query(const char *hserver, const char *hport,
sockfd = openconn(server + 1, NULL);
free(server);
server = query_afilias(sockfd, query);
- if (no_recursion)
+ if (no_recursion && server)
server[0] = '\0';
break;
case 0x0A: