mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
Merge tag 'selinux-pr-20200416' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull SELinux fix from Paul Moore: "One small SELinux fix to ensure we cleanup properly on an error condition" * tag 'selinux-pr-20200416' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: free str on error in str_read()
This commit is contained in:
@@ -1035,14 +1035,14 @@ static int str_read(char **strp, gfp_t flags, void *fp, u32 len)
|
||||
if (!str)
|
||||
return -ENOMEM;
|
||||
|
||||
/* it's expected the caller should free the str */
|
||||
*strp = str;
|
||||
|
||||
rc = next_entry(str, fp, len);
|
||||
if (rc)
|
||||
if (rc) {
|
||||
kfree(str);
|
||||
return rc;
|
||||
}
|
||||
|
||||
str[len] = '\0';
|
||||
*strp = str;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user