summaryrefslogtreecommitdiff
path: root/sys/crypto
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2002-06-12 17:25:39 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2002-06-12 17:25:39 +0000
commit6a31f07cdf324245240a4eef70de619e1c119ade (patch)
treeeadd48a2bcee29952a045ee9419d948e888f55e9 /sys/crypto
parentbe5bd1d8f99fc0e437d436705356f24d67db8ed2 (diff)
undo 1.46; fixes double free (the keys are freed on session close).
passes regress/sys/crypto
Diffstat (limited to 'sys/crypto')
-rw-r--r--sys/crypto/cryptodev.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/crypto/cryptodev.c b/sys/crypto/cryptodev.c
index fd0b9a5b0de..6e8fe3ef372 100644
--- a/sys/crypto/cryptodev.c
+++ b/sys/crypto/cryptodev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptodev.c,v 1.48 2002/06/12 04:16:02 deraadt Exp $ */
+/* $OpenBSD: cryptodev.c,v 1.49 2002/06/12 17:25:38 markus Exp $ */
/*
* Copyright (c) 2001 Theo de Raadt
@@ -277,10 +277,12 @@ cryptof_ioctl(fp, cmd, data, p)
sop->ses = cse->ses;
bail:
- if (crie.cri_key)
- FREE(crie.cri_key, M_XDATA);
- if (cria.cri_key)
- FREE(cria.cri_key, M_XDATA);
+ if (error) {
+ if (crie.cri_key)
+ FREE(crie.cri_key, M_XDATA);
+ if (cria.cri_key)
+ FREE(cria.cri_key, M_XDATA);
+ }
break;
case CIOCFSESSION: