Fix for warning: ‘free’ called on unallocated object ‘buf’.

This commit is contained in:
David Garske
2025-05-29 15:32:25 -07:00
parent 482f2bdd2a
commit 165f868be1
2 changed files with 4 additions and 2 deletions

View File

@@ -302,7 +302,9 @@ int wc_MakeDsaParameters(WC_RNG *rng, int modulus_size, DsaKey *dsa)
/* make a random string that will be multiplied against q */
err = wc_RNG_GenerateBlock(rng, buf, (word32)(msize - qsize));
if (err != MP_OKAY) {
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
XFREE(buf, dsa->heap, DYNAMIC_TYPE_TMP_BUFFER);
#endif
return err;
}

View File

@@ -2057,9 +2057,9 @@ enum Max_ASN {
MAX_PUBLIC_KEY_SZ = MAX_DSA_PUBKEY_SZ + MAX_ALGO_SZ + MAX_SEQ_SZ * 2,
#endif
#ifdef WOLFSSL_ENCRYPTED_KEYS
HEADER_ENCRYPTED_KEY_SIZE = 88,/* Extra header size for encrypted key */
HEADER_ENCRYPTED_KEY_SIZE = 88 /* Extra header size for encrypted key */
#else
HEADER_ENCRYPTED_KEY_SIZE = 0,
HEADER_ENCRYPTED_KEY_SIZE = 0
#endif
};