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

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
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);
	}
	ocontext_destroy(newc, OCON_FSUSE);

	return rc;