summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/engine/hw_cryptodev.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2006-06-08 00:16:44 +0000
committerderaadt <deraadt@openbsd.org>2006-06-08 00:16:44 +0000
commit892570b67fcee3523676e2ae1bc431864e827d0b (patch)
treef7c471939a7106acc616485a88ec603c21cb9716 /lib/libcrypto/engine/hw_cryptodev.c
parentmake sure, we initialize unspecified keys and spis. Noticed by (diff)
downloadwireguard-openbsd-892570b67fcee3523676e2ae1bc431864e827d0b.tar.xz
wireguard-openbsd-892570b67fcee3523676e2ae1bc431864e827d0b.zip
potential fd leak (we will fix this before we move to cloning)
Diffstat (limited to 'lib/libcrypto/engine/hw_cryptodev.c')
-rw-r--r--lib/libcrypto/engine/hw_cryptodev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libcrypto/engine/hw_cryptodev.c b/lib/libcrypto/engine/hw_cryptodev.c
index 924e379ab54..d3b186c1324 100644
--- a/lib/libcrypto/engine/hw_cryptodev.c
+++ b/lib/libcrypto/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) {