Commit 315e01ad authored by Markus Elfring's avatar Markus Elfring Committed by Paul Moore

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 3a0aa565
...@@ -2098,9 +2098,10 @@ static int genfs_read(struct policydb *p, void *fp) ...@@ -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;
......
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