]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
ts_conf: fix memory leak in TS_CONF_set_policies openssl-3.0 16786/head
authorDONGGEUN YOO <bleeqtheproducer@gmail.com>
Mon, 29 Sep 2025 00:45:11 +0000 (00:45 +0000)
committerTomas Mraz <tomas@openssl.org>
Wed, 1 Oct 2025 15:55:25 +0000 (17:55 +0200)
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 1f3a6602a13b382c0f09d6659e0d49ec2e41646d)

crypto/ts/ts_conf.c

index fd2ad90754b04f20756f84c4f43f042c28bc5905..921a2514f467375a82514d82cfcf7aaadd1dbaf9 100644 (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);
     }