From 7fcf2b27097fda927d637835468a83ed1b918001 Mon Sep 17 00:00:00 2001 From: Roberto Bergantinos Corpas Date: Mon, 10 May 2021 12:53:19 -0400 Subject: network_init: initialize response addrinfo list to NULL res pointer is not initialized, if for some reason it does not take any value after calling getaddrinfo, we end up causing oops when calling freeaddrinfo Signed-off-by: Roberto Bergantinos Corpas Signed-off-by: Steve Dickson --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index 564e3a2..4af8b9b 100644 --- a/src/util.c +++ b/src/util.c @@ -309,7 +309,7 @@ network_init() int s; #endif int ecode; - struct addrinfo hints, *res; + struct addrinfo hints, *res = NULL; memset(&hints, 0, sizeof hints); hints.ai_family = AF_INET; -- cgit v1.2.1