ts_conf: fix memory leak in TS_CONF_set_policies

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28686)

(cherry picked from commit 1f3a6602a1)
This commit is contained in:
DONGGEUN YOO 2025-09-29 00:45:11 +00:00 committed by Tomas Mraz
parent b5ab449e26
commit 8cfb565117
1 changed files with 3 additions and 1 deletions

View File

@ -330,8 +330,10 @@ int TS_CONF_set_policies(CONF *conf, const char *section, TS_RESP_CTX *ctx)
ts_CONF_invalid(section, ENV_OTHER_POLICIES);
goto err;
}
if (!TS_RESP_CTX_add_policy(ctx, objtmp))
if (!TS_RESP_CTX_add_policy(ctx, objtmp)) {
ASN1_OBJECT_free(objtmp);
goto err;
}
ASN1_OBJECT_free(objtmp);
}