summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2002-06-10 21:09:28 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2002-06-10 21:09:28 +0000
commitbb1632acf1613a796c22f6c4796d26c9f2fdc970 (patch)
tree901013d222e12a509a99fa192f23a0eacb7c51bc /sys
parentdac952ba779c7d98abb2f40fd0e5cb17b44ea8d8 (diff)
You should always free the keys, not just on error --- the crypto
framework doesn't hold on to these.
Diffstat (limited to 'sys')
-rw-r--r--sys/crypto/cryptodev.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/crypto/cryptodev.c b/sys/crypto/cryptodev.c
index 61ab161b9d0..d2f86852eaf 100644
--- a/sys/crypto/cryptodev.c
+++ b/sys/crypto/cryptodev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptodev.c,v 1.45 2002/06/07 08:09:04 nordin Exp $ */
+/* $OpenBSD: cryptodev.c,v 1.46 2002/06/10 21:09:27 angelos Exp $ */
/*
* Copyright (c) 2001 Theo de Raadt
@@ -276,12 +276,10 @@ cryptof_ioctl(fp, cmd, data, p)
sop->ses = cse->ses;
bail:
- if (error) {
- if (crie.cri_key)
- FREE(crie.cri_key, M_XDATA);
- if (cria.cri_key)
- FREE(cria.cri_key, M_XDATA);
- }
+ if (crie.cri_key)
+ FREE(crie.cri_key, M_XDATA);
+ if (cria.cri_key)
+ FREE(cria.cri_key, M_XDATA);
break;
case CIOCFSESSION: