Fix an error path leak in do_ext_nconf()
Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit 8605abf135
)
This commit is contained in:
parent
f6186cfba6
commit
4457017587
1 changed files with 3 additions and 1 deletions
|
@ -135,11 +135,13 @@ static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid,
|
|||
nval = NCONF_get_section(conf, value + 1);
|
||||
else
|
||||
nval = X509V3_parse_list(value);
|
||||
if (sk_CONF_VALUE_num(nval) <= 0) {
|
||||
if (nval == NULL || sk_CONF_VALUE_num(nval) <= 0) {
|
||||
X509V3err(X509V3_F_DO_EXT_NCONF,
|
||||
X509V3_R_INVALID_EXTENSION_STRING);
|
||||
ERR_add_error_data(4, "name=", OBJ_nid2sn(ext_nid), ",section=",
|
||||
value);
|
||||
if (*value != '@')
|
||||
sk_CONF_VALUE_free(nval);
|
||||
return NULL;
|
||||
}
|
||||
ext_struc = method->v2i(method, ctx, nval);
|
||||
|
|
Loading…
Reference in a new issue