diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2002-07-05 23:20:54 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2002-07-05 23:20:54 +0000 |
commit | 1708021ff9109001a4f0c79c7d80d49f9d3954ba (patch) | |
tree | c7303d00d77059d950f5a2d308213aedc6ebb2cc /sys/netinet/ip_esp.c | |
parent | 19be22e801fd0124dd8599483c7f9037e9e5a1af (diff) |
Free crp_opaque only after we've determined we're not going to
re-submit it. From sam@errno.com
Diffstat (limited to 'sys/netinet/ip_esp.c')
-rw-r--r-- | sys/netinet/ip_esp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c index 9c5a2c57f08..4a3e0797e95 100644 --- a/sys/netinet/ip_esp.c +++ b/sys/netinet/ip_esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp.c,v 1.73 2002/06/18 23:03:26 angelos Exp $ */ +/* $OpenBSD: ip_esp.c,v 1.74 2002/07/05 23:20:53 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -980,8 +980,8 @@ esp_output_cb(void *op) s = spltdb(); tdb = gettdb(tc->tc_spi, &tc->tc_dst, tc->tc_proto); - FREE(tc, M_XDATA); if (tdb == NULL) { + FREE(tc, M_XDATA); espstat.esps_notdb++; DPRINTF(("esp_output_cb(): TDB is expired while in crypto\n")); goto baddone; @@ -998,12 +998,14 @@ esp_output_cb(void *op) return crypto_dispatch(crp); } + FREE(tc, M_XDATA); espstat.esps_noxform++; DPRINTF(("esp_output_cb(): crypto error %d\n", crp->crp_etype)); error = crp->crp_etype; goto baddone; - } + } else + FREE(tc, M_XDATA); /* Shouldn't happen... */ if (m == NULL) { |