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>
Esse commit está contido em:
Markus Elfring
2017-01-14 17:43:47 +01:00
commit de Paul Moore
commit 315e01ada8

Ver arquivo

@@ -2098,9 +2098,10 @@ static int genfs_read(struct policydb *p, void *fp)
}
rc = 0;
out:
if (newgenfs)
if (newgenfs) {
kfree(newgenfs->fstype);
kfree(newgenfs);
kfree(newgenfs);
}
ocontext_destroy(newc, OCON_FSUSE);
return rc;