From 290663f8b298e3d8b70567d8cda86b068a9c7e1e Mon Sep 17 00:00:00 2001 From: Kaleb Himes Date: Mon, 3 Jun 2019 15:13:02 -0600 Subject: [PATCH] Feedback changes implemented --- wolfcrypt/src/pwdbased.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/pwdbased.c b/wolfcrypt/src/pwdbased.c index 7cf18ceb1..a5200d8de 100644 --- a/wolfcrypt/src/pwdbased.c +++ b/wolfcrypt/src/pwdbased.c @@ -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 (hmac == NULL) + if (hmac == NULL) { + XFREE(buffer, NULL, DYNAMIC_TYPE_TMP_BUFFER); return MEMORY_E; + } #endif ret = wc_HmacInit(hmac, NULL, INVALID_DEVID);