]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix memory leak in abnormal branch of mlx_kem_dup function
authorlan1120 <lanming@huawei.com>
Fri, 5 Dec 2025 10:09:47 +0000 (18:09 +0800)
committerTomas Mraz <tomas@openssl.org>
Thu, 11 Dec 2025 12:05:35 +0000 (13:05 +0100)
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29318)

(cherry picked from commit 013e1174df1b3f8a51b393aaa22309dab66d371f)

providers/implementations/keymgmt/mlx_kmgmt.c

index 0f5424cfacaec1c42649db8fcfc4e7297160562a..46ed63039ec7c3bf80bd72ca4474f610e2b6f1cb 100644 (file)
@@ -744,6 +744,7 @@ static void *mlx_kem_dup(const void *vkey, int selection)
         if (ret->xkey == NULL)
             return ret;
         /* Fail if the source key is an inconsistent state */
+        OPENSSL_free(ret->propq);
         OPENSSL_free(ret);
         return NULL;
     }