summaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'net.c')
-rw-r--r--net.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net.c b/net.c
index 8fc9c8c48d87..e944d018b357 100644
--- a/net.c
+++ b/net.c
@@ -754,6 +754,8 @@ ldns_tcp_read_wire_timeout(int sockfd, size_t *size, struct timeval timeout)
uint16_t wire_size;
ssize_t bytes = 0, rc = 0;
+ if(sockfd < 0)
+ return NULL;
wire = LDNS_XMALLOC(uint8_t, 2);
if (!wire) {
*size = 0;