diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-08-05 12:44:58 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-08-06 17:32:06 +0200 |
commit | c2b94c0a15254ad8cb28d07ed7793e975ae6736f (patch) | |
tree | 0338af17fa7a28a2d67d5adefec01e2881b1c230 | |
parent | 08e9ff76001e8b3972c894e0c7cbc94b0d1efb63 (diff) | |
download | openssl-new-c2b94c0a15254ad8cb28d07ed7793e975ae6736f.tar.gz |
Avoid freeing the conf lhashes in X509_V3_EXT*_add_conf
Fixes #16226
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16227)
-rw-r--r-- | crypto/x509/v3_conf.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/x509/v3_conf.c b/crypto/x509/v3_conf.c index 9997595653..1c11d671b2 100644 --- a/crypto/x509/v3_conf.c +++ b/crypto/x509/v3_conf.c @@ -487,6 +487,7 @@ X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, return NULL; CONF_set_nconf(ctmp, conf); ret = X509V3_EXT_nconf(ctmp, ctx, name, value); + CONF_set_nconf(ctmp, NULL); NCONF_free(ctmp); return ret; } @@ -501,6 +502,7 @@ X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, return NULL; CONF_set_nconf(ctmp, conf); ret = X509V3_EXT_nconf_nid(ctmp, ctx, ext_nid, value); + CONF_set_nconf(ctmp, NULL); NCONF_free(ctmp); return ret; } @@ -542,6 +544,7 @@ int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, return 0; CONF_set_nconf(ctmp, conf); ret = X509V3_EXT_add_nconf(ctmp, ctx, section, cert); + CONF_set_nconf(ctmp, NULL); NCONF_free(ctmp); return ret; } @@ -558,6 +561,7 @@ int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, return 0; CONF_set_nconf(ctmp, conf); ret = X509V3_EXT_CRL_add_nconf(ctmp, ctx, section, crl); + CONF_set_nconf(ctmp, NULL); NCONF_free(ctmp); return ret; } @@ -574,6 +578,7 @@ int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, return 0; CONF_set_nconf(ctmp, conf); ret = X509V3_EXT_REQ_add_nconf(ctmp, ctx, section, req); + CONF_set_nconf(ctmp, NULL); NCONF_free(ctmp); return ret; } |