diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-09-07 17:44:38 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-09-07 17:44:38 +1000 |
commit | 309e73dfe067b3b774ef6f57bf665f41373a81ca (patch) | |
tree | 8871e64a5bbf0383be950bfd55d613832a3f4b51 /crypto/cms | |
parent | 56456c3404b0ec27f93816d951ff7a58827481f0 (diff) |
Coverity Fixes
x_algor.c: Explicit null dereferenced
cms_sd.c: Resource leak
ts_rsp_sign.c Resource Leak
extensions_srvr.c: Resourse Leak
v3_alt.c: Resourse Leak
pcy_data.c: Resource Leak
cms_lib.c: Resource Leak
drbg_lib.c: Unchecked return code
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12531)
Diffstat (limited to 'crypto/cms')
-rw-r--r-- | crypto/cms/cms_lib.c | 3 | ||||
-rw-r--r-- | crypto/cms/cms_sd.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c index 57afba4361..cdd794e211 100644 --- a/crypto/cms/cms_lib.c +++ b/crypto/cms/cms_lib.c @@ -92,12 +92,13 @@ BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont) default: CMSerr(CMS_F_CMS_DATAINIT, CMS_R_UNSUPPORTED_TYPE); - return NULL; + goto err; } if (cmsbio) return BIO_push(cmsbio, cont); +err: if (!icont) BIO_free(cont); return NULL; diff --git a/crypto/cms/cms_sd.c b/crypto/cms/cms_sd.c index 29ba4c1b13..6030f07181 100644 --- a/crypto/cms/cms_sd.c +++ b/crypto/cms/cms_sd.c @@ -897,8 +897,10 @@ int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs, ASN1_INTEGER *key = NULL; if (keysize > 0) { key = ASN1_INTEGER_new(); - if (key == NULL || !ASN1_INTEGER_set(key, keysize)) + if (key == NULL || !ASN1_INTEGER_set(key, keysize)) { + ASN1_INTEGER_free(key); return 0; + } } alg = X509_ALGOR_new(); if (alg == NULL) { |