diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2013-11-28 20:28:35 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2013-11-28 20:28:35 +0000 |
commit | 94368b468a3cd88c8c3db1b96b6493aae64a9aaa (patch) | |
tree | 9b6a60668fa3d684599b7b403a53e628c5ba6aa3 | |
parent | 357582319e424760f297aab552f8be33d83929c6 (diff) |
don't leak duplicate flows; ok mikeb@
-rw-r--r-- | sbin/iked/config.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/iked/config.c b/sbin/iked/config.c index 99263f8698d..8c7698642a4 100644 --- a/sbin/iked/config.c +++ b/sbin/iked/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.21 2013/10/24 02:55:50 deraadt Exp $ */ +/* $OpenBSD: config.c,v 1.22 2013/11/28 20:28:34 markus Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org> @@ -687,7 +687,8 @@ config_getpolicy(struct iked *env, struct imsg *imsg) memcpy(flow, buf + offset, sizeof(*flow)); offset += sizeof(*flow); - RB_INSERT(iked_flows, &pol->pol_flows, flow); + if (RB_INSERT(iked_flows, &pol->pol_flows, flow)) + free(flow); } TAILQ_INSERT_TAIL(&env->sc_policies, pol, pol_entry); |