After "otype = calloc(1, sizeof(*otype))", it is reasonable to check the
value of otype, not ft.

Signed-off-by: Nicolas Iooss <[email protected]>
---
 libsepol/src/policydb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libsepol/src/policydb.c b/libsepol/src/policydb.c
index 3f9b1f3fd2ac..5b9b9f02f0b5 100644
--- a/libsepol/src/policydb.c
+++ b/libsepol/src/policydb.c
@@ -2558,7 +2558,7 @@ int filename_trans_read(policydb_t *p, struct policy_file 
*fp)
                if (!ft)
                        goto err;
                otype = calloc(1, sizeof(*otype));
-               if (!ft)
+               if (!otype)
                        goto err;
                rc = next_entry(buf, fp, sizeof(uint32_t));
                if (rc < 0)
-- 
2.11.0

_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].

Reply via email to