Call EVP_CIPHER_CTX_cleanup to avoid leaking memory that was allocated in EVP_DecryptInit_ex
Also add matching cleanup to EVP_EncryptInit_ex for symmetry (though I'm not convinced it actually leaks memory) Change-Id: Icf72dd9e0295d8b6ea55909266a43e684b16420f
This commit is contained in:
parent
848639bdfc
commit
06dc311817
1 changed files with 4 additions and 0 deletions
|
@ -1409,6 +1409,8 @@ static int encrypt_master_key(const char *passwd, const unsigned char *salt,
|
|||
SLOGE("encrypt_master_key: crypto_scrypt failed");
|
||||
}
|
||||
|
||||
EVP_CIPHER_CTX_cleanup(&e_ctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1458,6 +1460,8 @@ static int decrypt_master_key_aux(const char *passwd, unsigned char *salt,
|
|||
}
|
||||
}
|
||||
|
||||
EVP_CIPHER_CTX_cleanup(&d_ctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue