summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorderaadt <>2006-06-08 00:16:44 +0000
committerderaadt <>2006-06-08 00:16:44 +0000
commitd945e56864331387464e225d737b6d9157e0e62d (patch)
treef33d833e1b96b531163bcf915301cc8e389b72c9 /src/lib
parentfde88861f7c7717115785c496a4ed82b53b2202a (diff)
downloadopenbsd-d945e56864331387464e225d737b6d9157e0e62d.tar.gz
openbsd-d945e56864331387464e225d737b6d9157e0e62d.tar.bz2
openbsd-d945e56864331387464e225d737b6d9157e0e62d.zip
potential fd leak (we will fix this before we move to cloning)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/engine/hw_cryptodev.c4
-rw-r--r--src/lib/libssl/src/crypto/engine/hw_cryptodev.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libcrypto/engine/hw_cryptodev.c b/src/lib/libcrypto/engine/hw_cryptodev.c
index 924e379ab5..d3b186c132 100644
--- a/src/lib/libcrypto/engine/hw_cryptodev.c
+++ b/src/lib/libcrypto/engine/hw_cryptodev.c
@@ -193,8 +193,10 @@ get_dev_crypto(void)
193 193
194 if ((fd = open_dev_crypto()) == -1) 194 if ((fd = open_dev_crypto()) == -1)
195 return (-1); 195 return (-1);
196 if (ioctl(fd, CRIOGET, &retfd) == -1) 196 if (ioctl(fd, CRIOGET, &retfd) == -1) {
197 close(fd);
197 return (-1); 198 return (-1);
199 }
198 200
199 /* close on exec */ 201 /* close on exec */
200 if (fcntl(retfd, F_SETFD, 1) == -1) { 202 if (fcntl(retfd, F_SETFD, 1) == -1) {
diff --git a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c
index 924e379ab5..d3b186c132 100644
--- a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c
+++ b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c
@@ -193,8 +193,10 @@ get_dev_crypto(void)
193 193
194 if ((fd = open_dev_crypto()) == -1) 194 if ((fd = open_dev_crypto()) == -1)
195 return (-1); 195 return (-1);
196 if (ioctl(fd, CRIOGET, &retfd) == -1) 196 if (ioctl(fd, CRIOGET, &retfd) == -1) {
197 close(fd);
197 return (-1); 198 return (-1);
199 }
198 200
199 /* close on exec */ 201 /* close on exec */
200 if (fcntl(retfd, F_SETFD, 1) == -1) { 202 if (fcntl(retfd, F_SETFD, 1) == -1) {