diff options
Diffstat (limited to 'crypto/pkcs7/pk7_attr.c')
-rw-r--r-- | crypto/pkcs7/pk7_attr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/pkcs7/pk7_attr.c b/crypto/pkcs7/pk7_attr.c index 5f7167048e..a96f41e1b9 100644 --- a/crypto/pkcs7/pk7_attr.c +++ b/crypto/pkcs7/pk7_attr.c @@ -74,7 +74,11 @@ int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg) alg->parameter->value.integer = nbit; alg->parameter->type = V_ASN1_INTEGER; } - sk_X509_ALGOR_push(sk, alg); + if (!sk_X509_ALGOR_push(sk, alg)) { + PKCS7err(PKCS7_F_PKCS7_SIMPLE_SMIMECAP, ERR_R_MALLOC_FAILURE); + X509_ALGOR_free(alg); + return 0; + } return 1; } |