libsepol: verify the right variable after calling calloc()

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

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
Nicolas Iooss 2017-01-15 14:03:56 +01:00 committed by Stephen Smalley
parent fd9e5ef7b7
commit ebe24ad20b

View File

@ -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)