Close /dev/crypto file descriptor after CRIOGET ioctl().
@@ -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
