mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
trusted keys: Fix a memory leak in trusted_update().
One failure path in security/keys/trusted.c::trusted_update() does not free 'new_p' while the others do. This patch makes sure we also free it in the remaining path (if datablob_parse() returns different from Opt_update). Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
parent
7f3c68bee9
commit
5403110943
1 changed files with 1 additions and 0 deletions
|
@ -1032,6 +1032,7 @@ static int trusted_update(struct key *key, const void *data, size_t datalen)
|
|||
ret = datablob_parse(datablob, new_p, new_o);
|
||||
if (ret != Opt_update) {
|
||||
ret = -EINVAL;
|
||||
kfree(new_p);
|
||||
goto out;
|
||||
}
|
||||
/* copy old key values, and reseal with new pcrs */
|
||||
|
|
Loading…
Reference in a new issue