summaryrefslogtreecommitdiff
path: root/deps/openssl/openssl/crypto/x509v3/v3_conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'deps/openssl/openssl/crypto/x509v3/v3_conf.c')
-rw-r--r--deps/openssl/openssl/crypto/x509v3/v3_conf.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/deps/openssl/openssl/crypto/x509v3/v3_conf.c b/deps/openssl/openssl/crypto/x509v3/v3_conf.c
index c1b4c1a89f..a38848cc1d 100644
--- a/deps/openssl/openssl/crypto/x509v3/v3_conf.c
+++ b/deps/openssl/openssl/crypto/x509v3/v3_conf.c
@@ -4,7 +4,7 @@
* 1999.
*/
/* ====================================================================
- * Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 1999-2018 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -340,8 +340,12 @@ int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section,
val = sk_CONF_VALUE_value(nval, i);
if (!(ext = X509V3_EXT_nconf(conf, ctx, val->name, val->value)))
return 0;
- if (sk)
- X509v3_add_ext(sk, ext, -1);
+ if (sk != NULL) {
+ if (X509v3_add_ext(sk, ext, -1) == NULL) {
+ X509_EXTENSION_free(ext);
+ return 0;
+ }
+ }
X509_EXTENSION_free(ext);
}
return 1;