summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobhe <tobhe@openbsd.org>2021-02-07 00:51:53 +0000
committertobhe <tobhe@openbsd.org>2021-02-07 00:51:53 +0000
commitecc1692e34e13f292fc307be0da99bedb5785e96 (patch)
treed4d61e0dcbd62ea7de513d25048a43d5fe26a311
parentwhile learning (teachgammon(1)) you might want to save your game so "{w,c}path" (diff)
downloadwireguard-openbsd-ecc1692e34e13f292fc307be0da99bedb5785e96.tar.xz
wireguard-openbsd-ecc1692e34e13f292fc307be0da99bedb5785e96.zip
Fix address leaks in expand_flows().
ok patrick@
-rw-r--r--sbin/iked/parse.y8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/iked/parse.y b/sbin/iked/parse.y
index b9fa14b29a5..ff6fa16f094 100644
--- a/sbin/iked/parse.y
+++ b/sbin/iked/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.125 2021/02/01 15:13:15 tobhe Exp $ */
+/* $OpenBSD: parse.y,v 1.126 2021/02/07 00:51:53 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
@@ -3209,6 +3209,8 @@ expand_flows(struct iked_policy *pol, struct ipsec_addr_wrap *src,
if (create_flow(pol, ipa, ipb))
goto done;
+ iaw_free(ipa);
+ iaw_free(ipb);
src->af = dst->af = AF_INET6;
ipa = expand_keyword(src);
ipb = expand_keyword(dst);
@@ -3234,8 +3236,8 @@ expand_flows(struct iked_policy *pol, struct ipsec_addr_wrap *src,
goto done;
ret = 0;
done:
- free(ipa);
- free(ipb);
+ iaw_free(ipa);
+ iaw_free(ipb);
return (ret);
}