diff options
author | Lutz Jänicke <jaenicke@openssl.org> | 2003-11-24 16:48:52 +0000 |
---|---|---|
committer | Lutz Jänicke <jaenicke@openssl.org> | 2003-11-24 16:48:52 +0000 |
commit | d7559f16cdded5c655f9228c1daf9f244f484a89 (patch) | |
tree | ff642f4889e6eb46b4bb772291648cf808a33285 | |
parent | 9e989810bade356f3edd599d5b62d159795f2d53 (diff) | |
download | openssl-d7559f16cdded5c655f9228c1daf9f244f484a89.tar.gz |
Free "engine" resource in case of failure to prevent memory leak
PR: #778
Submitted by: George Mitchell <george@m5p.com>
-rw-r--r-- | crypto/engine/eng_cryptodev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c index e93b7fd1a2..f8a4a292b5 100644 --- a/crypto/engine/eng_cryptodev.c +++ b/crypto/engine/eng_cryptodev.c @@ -1055,14 +1055,17 @@ ENGINE_load_cryptodev(void) if (engine == NULL) return; - if ((fd = get_dev_crypto()) < 0) + if ((fd = get_dev_crypto()) < 0) { + ENGINE_free(engine); return; + } /* * find out what asymmetric crypto algorithms we support */ if (ioctl(fd, CIOCASYMFEAT, &cryptodev_asymfeat) == -1) { close(fd); + ENGINE_free(engine); return; } close(fd); |