]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
ts_conf: fix memory leak in TS_CONF_set_policies
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:54:27 +0000 (17:54 +0200)
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28686)

crypto/ts/ts_conf.c

index 7e57858f4295088f2d2e0799f8178f462d457cf7..59737a5cec08756a06c6059c6b40cd2614671f1c 100644 (file)
@@ -342,8 +342,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);
     }