Issue #18582: fix memory leak in pbkdf2 code

This commit is contained in:
Christian Heimes 2013-11-06 17:25:17 +01:00
parent 95887b7e5b
commit 6853108ccd
1 changed files with 1 additions and 0 deletions

View File

@ -535,6 +535,7 @@ PKCS5_PBKDF2_HMAC_fast(const char *pass, int passlen,
HMAC_CTX_cleanup(&hctx); HMAC_CTX_cleanup(&hctx);
return 0; return 0;
} }
HMAC_CTX_cleanup(&hctx);
memcpy(p, digtmp, cplen); memcpy(p, digtmp, cplen);
for (j = 1; j < iter; j++) { for (j = 1; j < iter; j++) {
if (!HMAC_CTX_copy(&hctx, &hctx_tpl)) { if (!HMAC_CTX_copy(&hctx, &hctx_tpl)) {