mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +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)
|
if (!str)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* it's expected the caller should free the str */
|
|
||||||
*strp = str;
|
|
||||||
|
|
||||||
rc = next_entry(str, fp, len);
|
rc = next_entry(str, fp, len);
|
||||||
if (rc)
|
if (rc) {
|
||||||
|
kfree(str);
|
||||||
return rc;
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
str[len] = '\0';
|
str[len] = '\0';
|
||||||
|
*strp = str;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user