aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2001-04-04 22:30:26 +0000
committerDr. Stephen Henson <steve@openssl.org>2001-04-04 22:30:26 +0000
commit592f5c5797e1f6d51328ebbb0192c8cf7af570c6 (patch)
treece6b627f76bd5be895a9d5380badde8722c992f8
parent14ba3116766a5263d887f4c301b39752d48cf950 (diff)
downloadopenssl-592f5c5797e1f6d51328ebbb0192c8cf7af570c6.tar.gz
Fix couple of memory leaks in PKCS7_dataDecode().
-rw-r--r--CHANGES3
-rw-r--r--crypto/pkcs7/pk7_doit.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index f716208209..fb8d3a1cc9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,9 @@
Changes between 0.9.6 and 0.9.6a [xx XXX 2001]
+ *) Fix a couple of memory leaks in PKCS7_dataDecode()
+ [Steve Henson, reported by Heyun Zheng <hzheng@atdsprint.com>]
+
*) Change Configure and Makefiles to provide EXE_EXT, which will contain
the default extension for executables, if any. Also, make the perl
scripts that use symlink() to test if it really exists and use "cp"
diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c
index a4e1f6c864..bf43d030ad 100644
--- a/crypto/pkcs7/pk7_doit.c
+++ b/crypto/pkcs7/pk7_doit.c
@@ -370,7 +370,7 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
if (ri == NULL) {
PKCS7err(PKCS7_F_PKCS7_DATADECODE,
PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE);
- return(NULL);
+ goto err;
}
jj=EVP_PKEY_size(pkey);
@@ -393,7 +393,7 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
BIO_get_cipher_ctx(etmp,&evp_ctx);
EVP_CipherInit(evp_ctx,evp_cipher,NULL,NULL,0);
if (EVP_CIPHER_asn1_to_param(evp_ctx,enc_alg->parameter) < 0)
- return(NULL);
+ goto err;
if (jj != EVP_CIPHER_CTX_key_length(evp_ctx)) {
/* Some S/MIME clients don't use the same key