]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
ts_conf: fix memory leak in TS_CONF_set_policies openssl-3.3
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:12 +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 158e1c424258d8f2212ce2d2588d3becf8eca024..af687b7ceb488c466943c9a0056a503c73271a9f 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);
     }