From bcd4db3d02583ff3b2b7431d2696e09a4bd1cc72 Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Wed, 15 Sep 2021 09:22:09 +0200
Subject: [PATCH] FIX: Fix issue #97

If getaddrinfo fails we should exit be cause we can't do anything now.
It's better to log and abort than letting lkt SEGV with a maybe unknown
reason.
---
 src/main/lkt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/lkt.c b/src/main/lkt.c
index d385f5ae..9896751e 100644
--- a/src/main/lkt.c
+++ b/src/main/lkt.c
@@ -273,7 +273,8 @@ create_socket(const char *host, const char *port)
         hints.ai_socktype = SOCK_STREAM;
 
         if (getaddrinfo(host, port, &hints, &found) != 0 || (found == NULL))
-            LOG_DEBUG("NET", "getaddrinfo failed, this can be due to php invocation of lkt...");
+            LOG_FATAL("getaddrinfo failed, this can be due to php "
+                      "invocation of lkt or an invalid hostname...");
 
         sock     = *found->ai_addr;
         sock_len = found->ai_addrlen;
-- 
GitLab