From: DONGGEUN YOO Date: Mon, 29 Sep 2025 00:45:11 +0000 (+0000) Subject: ts_conf: fix memory leak in TS_CONF_set_policies X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Fopenssl-3.3;p=thirdparty%2Fopenssl.git ts_conf: fix memory leak in TS_CONF_set_policies Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/28686) (cherry picked from commit 1f3a6602a13b382c0f09d6659e0d49ec2e41646d) --- diff --git a/crypto/ts/ts_conf.c b/crypto/ts/ts_conf.c index 158e1c42425..af687b7ceb4 100644 --- a/crypto/ts/ts_conf.c +++ b/crypto/ts/ts_conf.c @@ -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); }