diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-08-19 18:24:30 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-08-19 18:24:30 +0000 |
commit | 1903abf5243dd15827642885cd4b3c2c240001f8 (patch) | |
tree | 674c9d7bd3da7c177fbb547b9e38a142fb06dd14 | |
parent | d80af6ab84cb96f2e077d1e92bfdfaf7d2e87826 (diff) |
Prevent section leak in conf space.
-rw-r--r-- | sbin/isakmpd/pf_key_v2.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/sbin/isakmpd/pf_key_v2.c b/sbin/isakmpd/pf_key_v2.c index 9d19c73dd4b..58dbc18f02a 100644 --- a/sbin/isakmpd/pf_key_v2.c +++ b/sbin/isakmpd/pf_key_v2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_key_v2.c,v 1.84 2001/08/14 20:33:02 ho Exp $ */ +/* $OpenBSD: pf_key_v2.c,v 1.85 2001/08/19 18:24:29 angelos Exp $ */ /* $EOM: pf_key_v2.c,v 1.79 2000/12/12 00:33:19 niklas Exp $ */ /* @@ -2255,22 +2255,18 @@ pf_key_v2_remove_conf (char *section) af = conf_begin (); configname = conf_get_str (section, "Configuration"); - - if (pf_key_v2_conf_refhandle (af, section)) - { - conf_end (af, 1); - return 0; - } - conf_remove_section (af, configname); + /* These are the Phase 2 Local/Remote IDs. */ localid = conf_get_str (section, "Local-ID"); + pf_key_v2_conf_refhandle (af, localid); + remoteid = conf_get_str (section, "Remote-ID"); + pf_key_v2_conf_refhandle (af, remoteid); + ikepeer = conf_get_str (section, "ISAKMP-peer"); - /* These are the Phase 2 Local/Remote IDs. */ - pf_key_v2_conf_refhandle (af, localid); - pf_key_v2_conf_refhandle (af, remoteid); + pf_key_v2_conf_refhandle (af, section); if (ikepeer) { @@ -2278,12 +2274,7 @@ pf_key_v2_remove_conf (char *section) localid = conf_get_str (ikepeer, "ID"); configname = conf_get_str (ikepeer, "Configuration"); - if (pf_key_v2_conf_refhandle (af, ikepeer)) - { - conf_end (af, 1); - return 0; - } - + pf_key_v2_conf_refhandle (af, ikepeer); pf_key_v2_conf_refhandle (af, configname); /* Phase 1 IDs */ |