summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-02-25 18:43:43 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-02-25 18:43:43 +0000
commit9cb83db9db265a796602624ff52b46c74a8e1b62 (patch)
treed3bb9323bd877bbdf2f13060bc8d99d684c77f89 /sys/netinet
parent9c5b9d1592666b18ac53bc95f88d3b1766bb587c (diff)
Be a bit more paranoid before free'ing memory.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_esp_new.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/ip_esp_new.c b/sys/netinet/ip_esp_new.c
index 90976c000a4..e39db26f067 100644
--- a/sys/netinet/ip_esp_new.c
+++ b/sys/netinet/ip_esp_new.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_esp_new.c,v 1.36 1999/02/24 23:45:49 angelos Exp $ */
+/* $OpenBSD: ip_esp_new.c,v 1.37 1999/02/25 18:43:42 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -368,13 +368,13 @@ esp_new_init(struct tdb *tdbp, struct xformsw *xsp, struct ipsecinit *ii)
int
esp_new_zeroize(struct tdb *tdbp)
{
- if (tdbp->tdb_encalgxform && tdbp->tdb_encalgxform->type == SADB_EALG_X_SKIPJACK)
- {
- int k;
+ int k;
- for (k = 0; k < 10; k++)
+ if (tdbp->tdb_encalgxform && tdbp->tdb_key &&
+ tdbp->tdb_encalgxform->type == SADB_EALG_X_SKIPJACK)
+ for (k = 0; k < 10; k++)
+ if (((u_int8_t **)tdbp->tdb_key)[k] != NULL)
FREE(((u_int8_t **)tdbp->tdb_key)[k], M_XDATA);
- }
if (tdbp->tdb_key)
{