hirc

IRC client
Log | Files | Refs

commit cca3291d14a78d292099b9c0ccb56f12d690b37c
parent 7eb311c7ced65471fbd33a317b5e2261fe67fe82
Author: hhvn <dev@hhvn.uk>
Date:   Mon, 13 Dec 2021 19:17:37 +0000

s/serv.c: no segfault on failed lookup

Diffstat:
Msrc/serv.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/serv.c b/src/serv.c @@ -273,7 +273,8 @@ fail: serv_disconnect(server, 1, NULL); if (server->connectfail * config_getl("reconnect.interval") < config_getl("reconnect.maxinterval")) server->connectfail += 1; - freeaddrinfo(ai); + if (ai) + freeaddrinfo(ai); } int