summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509_v3.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/x509/x509_v3.c')
-rw-r--r--src/lib/libcrypto/x509/x509_v3.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/lib/libcrypto/x509/x509_v3.c b/src/lib/libcrypto/x509/x509_v3.c
index 42e6f0ab05..67b1796a92 100644
--- a/src/lib/libcrypto/x509/x509_v3.c
+++ b/src/lib/libcrypto/x509/x509_v3.c
@@ -147,13 +147,7 @@ STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
147 int n; 147 int n;
148 STACK_OF(X509_EXTENSION) *sk=NULL; 148 STACK_OF(X509_EXTENSION) *sk=NULL;
149 149
150 if (x == NULL) 150 if ((x != NULL) && (*x == NULL))
151 {
152 X509err(X509_F_X509V3_ADD_EXT,ERR_R_PASSED_NULL_PARAMETER);
153 goto err2;
154 }
155
156 if (*x == NULL)
157 { 151 {
158 if ((sk=sk_X509_EXTENSION_new_null()) == NULL) 152 if ((sk=sk_X509_EXTENSION_new_null()) == NULL)
159 goto err; 153 goto err;
@@ -169,7 +163,7 @@ STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
169 goto err2; 163 goto err2;
170 if (!sk_X509_EXTENSION_insert(sk,new_ex,loc)) 164 if (!sk_X509_EXTENSION_insert(sk,new_ex,loc))
171 goto err; 165 goto err;
172 if (*x == NULL) 166 if ((x != NULL) && (*x == NULL))
173 *x=sk; 167 *x=sk;
174 return(sk); 168 return(sk);
175err: 169err: