]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Close /dev/crypto file descriptor after CRIOGET ioctl().
authorJohn Baldwin <jhb@FreeBSD.org>
Thu, 7 Jan 2021 22:09:41 +0000 (14:09 -0800)
committerBenjamin Kaduk <bkaduk@akamai.com>
Thu, 18 Feb 2021 21:38:20 +0000 (13:38 -0800)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(cherry picked from commit 3ddf44ea5a2c1c8c55f4f4072a611791c79d4e7c)

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13853)

crypto/engine/eng_devcrypto.c

index f03c017181323fb8dd282453fdf930de288d3cc1..997271e1505521ca36322c6828894d103c24e49d 100644 (file)
@@ -771,9 +771,11 @@ void engine_load_devcrypto_int()
 #ifdef CRIOGET
     if (ioctl(fd, CRIOGET, &cfd) < 0) {
         fprintf(stderr, "Could not create crypto fd: %s\n", strerror(errno));
+        close(fd);
         cfd = -1;
         return;
     }
+    close(fd);
 #else
     cfd = fd;
 #endif