Skip to content

Commit 165f868

Browse files
committed
Fix for warning: ‘free’ called on unallocated object ‘buf’.
1 parent 482f2bd commit 165f868

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

wolfcrypt/src/dsa.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ int wc_MakeDsaParameters(WC_RNG *rng, int modulus_size, DsaKey *dsa)
302302
/* make a random string that will be multiplied against q */
303303
err = wc_RNG_GenerateBlock(rng, buf, (word32)(msize - qsize));
304304
if (err != MP_OKAY) {
305+
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
305306
XFREE(buf, dsa->heap, DYNAMIC_TYPE_TMP_BUFFER);
307+
#endif
306308
return err;
307309
}
308310

wolfssl/wolfcrypt/types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2057,9 +2057,9 @@ enum Max_ASN {
20572057
MAX_PUBLIC_KEY_SZ = MAX_DSA_PUBKEY_SZ + MAX_ALGO_SZ + MAX_SEQ_SZ * 2,
20582058
#endif
20592059
#ifdef WOLFSSL_ENCRYPTED_KEYS
2060-
HEADER_ENCRYPTED_KEY_SIZE = 88,/* Extra header size for encrypted key */
2060+
HEADER_ENCRYPTED_KEY_SIZE = 88 /* Extra header size for encrypted key */
20612061
#else
2062-
HEADER_ENCRYPTED_KEY_SIZE = 0,
2062+
HEADER_ENCRYPTED_KEY_SIZE = 0
20632063
#endif
20642064
};
20652065

0 commit comments

Comments
 (0)