forked from wolfSSL/wolfssl
Merge pull request #2266 from kaleb-himes/ZD-5154
Check correct allocation assignment. Thanks to R.A. for the report on…
This commit is contained in:
@ -198,8 +198,10 @@ int wc_PBKDF2(byte* output, const byte* passwd, int pLen, const byte* salt,
|
||||
if (buffer == NULL)
|
||||
return MEMORY_E;
|
||||
hmac = (Hmac*)XMALLOC(sizeof(Hmac), NULL, DYNAMIC_TYPE_HMAC);
|
||||
if (buffer == NULL)
|
||||
if (hmac == NULL) {
|
||||
XFREE(buffer, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
return MEMORY_E;
|
||||
}
|
||||
#endif
|
||||
|
||||
ret = wc_HmacInit(hmac, NULL, INVALID_DEVID);
|
||||
|
Reference in New Issue
Block a user