Commit 9786cab6 authored by Linus Torvalds's avatar Linus Torvalds

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()
parents 3fa84bf9 af15f14c
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment