]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
x509: fix memleaks after ML-DSA key consistency check
authorDaiki Ueno <ueno@gnu.org>
Fri, 4 Jul 2025 07:55:21 +0000 (16:55 +0900)
committerDaiki Ueno <ueno@gnu.org>
Fri, 4 Jul 2025 09:20:20 +0000 (18:20 +0900)
Signed-off-by: Daiki Ueno <ueno@gnu.org>
lib/x509/privkey_pkcs8.c

index d0142d4cfd7a501dd6c1ed1b85071b4274ff883b..987f8c79622568679d0cf8073defc745086d4f35 100644 (file)
@@ -1712,6 +1712,7 @@ static int decode_ml_dsa_inner_private_key(const gnutls_datum_t *raw_key,
                        _gnutls_free_key_datum(&raw_priv);
                        goto cleanup;
                }
+               _gnutls_free_key_datum(&raw_priv);
        }
 
 cleanup:
@@ -1795,6 +1796,7 @@ static int _decode_pkcs8_ml_dsa_key(asn1_node pkcs8_asn,
                        _gnutls_free_key_datum(&raw_pub);
                        goto cleanup;
                }
+               _gnutls_free_key_datum(&raw_pub);
        }
 
        /* Sanity check that the resulting keys have the expected sizes */