summaryrefslogtreecommitdiff
path: root/usr.sbin/ikectl
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2018-06-18 10:20:20 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2018-06-18 10:20:20 +0000
commitf825055bad0bb983687f4f1e69e323bd9a339164 (patch)
tree20c3f027a7ea302ea02dc8520c2f207be5e6c05d /usr.sbin/ikectl
parent498960d884c8dc4744bbdbbb15b0c6ab6652ec92 (diff)
fix memory leak: freeaddrinfo() the data from getaddrinfo().
From Thomas Barabosch <thomas DOT barabosch AT fkie DOT fraunhofer DOT de> Thanks. ok jca@
Diffstat (limited to 'usr.sbin/ikectl')
-rw-r--r--usr.sbin/ikectl/parser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ikectl/parser.c b/usr.sbin/ikectl/parser.c
index 52488845fd3..05baadb93c9 100644
--- a/usr.sbin/ikectl/parser.c
+++ b/usr.sbin/ikectl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.16 2016/06/14 13:45:40 reyk Exp $ */
+/* $OpenBSD: parser.c,v 1.17 2018/06/18 10:20:19 benno Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -273,6 +273,7 @@ parse_addr(const char *word)
hints.ai_family = PF_UNSPEC;
hints.ai_flags = AI_NUMERICHOST;
if (getaddrinfo(word, "0", &hints, &r) == 0) {
+ freeaddrinfo(r);
return (0);
}
@@ -327,7 +328,6 @@ match_token(char *word, const struct token table[])
case ADDRESS:
case FQDN:
if (!match && word != NULL && strlen(word) > 0) {
- parse_addr(word);
res.host = strdup(word);
if (parse_addr(word) == 0)
res.htype = HOST_IPADDR;