Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit b437aba8 authored by Himanshu Shukla's avatar Himanshu Shukla Committed by Casey Schaufler
Browse files

SMACK: Fix the memory leak in smack_cred_prepare() hook



Memory leak in smack_cred_prepare()function.
smack_cred_prepare() hook returns error if there is error in allocating
memory in smk_copy_rules() or smk_copy_relabel() function.
If smack_cred_prepare() function returns error then the calling
function should call smack_cred_free() function for cleanup.
In smack_cred_free() function first credential is  extracted and
then all rules are deleted. In smack_cred_prepare() function security
field is assigned in the end when all function return success. But this
function may return before and memory will not be freed.

Signed-off-by: default avatarHimanshu Shukla <himanshu.sh@samsung.com>
Acked-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
parent 7128ea15
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment