aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssl/crypto/x509/x509_att.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/crypto/x509/x509_att.c')
-rw-r--r--crypto/openssl/crypto/x509/x509_att.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/crypto/openssl/crypto/x509/x509_att.c b/crypto/openssl/crypto/x509/x509_att.c
index 0bae3d32a1a5..65968c4944aa 100644
--- a/crypto/openssl/crypto/x509/x509_att.c
+++ b/crypto/openssl/crypto/x509/x509_att.c
@@ -125,7 +125,13 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
X509_ATTRIBUTE *new_attr=NULL;
STACK_OF(X509_ATTRIBUTE) *sk=NULL;
- if ((x != NULL) && (*x == NULL))
+ if (x == NULL)
+ {
+ X509err(X509_F_X509AT_ADD1_ATTR, ERR_R_PASSED_NULL_PARAMETER);
+ goto err2;
+ }
+
+ if (*x == NULL)
{
if ((sk=sk_X509_ATTRIBUTE_new_null()) == NULL)
goto err;
@@ -137,11 +143,11 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
goto err2;
if (!sk_X509_ATTRIBUTE_push(sk,new_attr))
goto err;
- if ((x != NULL) && (*x == NULL))
+ if (*x == NULL)
*x=sk;
return(sk);
err:
- X509err(X509_F_X509_ADD_ATTR,ERR_R_MALLOC_FAILURE);
+ X509err(X509_F_X509AT_ADD1_ATTR,ERR_R_MALLOC_FAILURE);
err2:
if (new_attr != NULL) X509_ATTRIBUTE_free(new_attr);
if (sk != NULL) sk_X509_ATTRIBUTE_free(sk);