From: John Baldwin Date: Thu, 7 Jan 2021 22:09:41 +0000 (-0800) Subject: Close /dev/crypto file descriptor after CRIOGET ioctl(). X-Git-Tag: openssl-3.0.0-alpha11~142 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3ddf44ea5a2c1c8c55f4f4072a611791c79d4e7c;p=thirdparty%2Fopenssl.git Close /dev/crypto file descriptor after CRIOGET ioctl(). Reviewed-by: Matt Caswell Reviewed-by: Ben Kaduk (Merged from https://github.com/openssl/openssl/pull/13807) --- diff --git a/engines/e_devcrypto.c b/engines/e_devcrypto.c index d549edfd295..e1c4372f729 100644 --- a/engines/e_devcrypto.c +++ b/engines/e_devcrypto.c @@ -1236,9 +1236,11 @@ static int open_devcrypto(void) #ifdef CRIOGET if (ioctl(fd, CRIOGET, &cfd) < 0) { fprintf(stderr, "Could not create crypto fd: %s\n", strerror(errno)); + close(fd); cfd = -1; return 0; } + close(fd); #else cfd = fd; #endif