commit caba10978888df9b472b2369f9c4ba76266cf634
parent 376940d376b81cdd7ab41a36c72ad937c4678cb1
Author: hhvn <dev@hhvn.uk>
Date: Sun, 6 Jun 2021 21:19:36 +0100
finger.c: use freeaddrinfo()
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/finger.c b/finger.c
@@ -77,6 +77,9 @@ finger(char *user, char *host, char *port, int w) {
die(1, "%s%s\n", verbose ? "socket(): " : "", strerror(errno));
if (connect(sock, ai->ai_addr, ai->ai_addrlen) == -1)
die(1, "%s%s\n", verbose ? "connect(): " : "", strerror(errno));
+
+ freeaddrinfo(&hints);
+ freeaddrinfo(ai);
if (strcmp(port, "79") == 0)
printf("[%s@%s]\n", user, host);