From a36259435c17f76cf12476234a56f40fcd8faf41 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Tue, 18 Nov 2008 15:11:27 +0000 Subject: [PATCH] Prevent freeing a NULL pointer when a hostname is unresolvable. --- src/net_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/net_socket.c b/src/net_socket.c index bf5130d6..753229b4 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -300,7 +300,8 @@ begin: } if(!c->outgoing->aip) { - freeaddrinfo(c->outgoing->ai); + if(c->outgoing->ai) + freeaddrinfo(c->outgoing->ai); c->outgoing->ai = NULL; goto begin; } -- 2.39.5