summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-06-08 00:16:45 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-06-08 00:16:45 +0000
commit369a79fb1f9a438ea0be092f79096a2e5437f963 (patch)
tree07700ed8e42435a5990d1150ecbb1985a3140abe /lib
parent80c556ced4a4f4c7f34331054a12628b856a319f (diff)
potential fd leak (we will fix this before we move to cloning)
Diffstat (limited to 'lib')
-rw-r--r--lib/libssl/src/crypto/engine/hw_cryptodev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libssl/src/crypto/engine/hw_cryptodev.c b/lib/libssl/src/crypto/engine/hw_cryptodev.c
index 924e379ab54..d3b186c1324 100644
--- a/lib/libssl/src/crypto/engine/hw_cryptodev.c
+++ b/lib/libssl/src/crypto/engine/hw_cryptodev.c
@@ -193,8 +193,10 @@ get_dev_crypto(void)
if ((fd = open_dev_crypto()) == -1)
return (-1);
- if (ioctl(fd, CRIOGET, &retfd) == -1)
+ if (ioctl(fd, CRIOGET, &retfd) == -1) {
+ close(fd);
return (-1);
+ }
/* close on exec */
if (fcntl(retfd, F_SETFD, 1) == -1) {