From 70ff9835c415e893131dd8dbe643c6f5e4873c53 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Thu, 8 Jun 2006 00:16:45 +0000 Subject: potential fd leak (we will fix this before we move to cloning) --- lib/libcrypto/engine/hw_cryptodev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3