summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net.c b/net.c
index 4551f3e..7ce9ef4 100644
--- a/net.c
+++ b/net.c
@@ -412,7 +412,10 @@ addrretry:
error:
rv = REDIS_ERR;
end:
- freeaddrinfo(servinfo);
+ if(servinfo) {
+ freeaddrinfo(servinfo);
+ }
+
return rv; // Need to return REDIS_OK if alright
}