mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
selinux: One function call less in genfs_read() after null pointer detection
Call the function "kfree" at the end only after it was determined that the local variable "newgenfs" contained a non-null pointer. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
parent
3a0aa56518
commit
315e01ada8
1 changed files with 3 additions and 2 deletions
|
@ -2098,9 +2098,10 @@ static int genfs_read(struct policydb *p, void *fp)
|
||||||
}
|
}
|
||||||
rc = 0;
|
rc = 0;
|
||||||
out:
|
out:
|
||||||
if (newgenfs)
|
if (newgenfs) {
|
||||||
kfree(newgenfs->fstype);
|
kfree(newgenfs->fstype);
|
||||||
kfree(newgenfs);
|
kfree(newgenfs);
|
||||||
|
}
|
||||||
ocontext_destroy(newc, OCON_FSUSE);
|
ocontext_destroy(newc, OCON_FSUSE);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
|
Loading…
Reference in a new issue