Skip to content

Commit

Permalink
selinux: fix a possible memory leak in cond_read_node()
Browse files Browse the repository at this point in the history
The cond_read_node() should free the given node on error path as it's
not linked to p->cond_list yet.  This is done via cond_node_destroy()
but it's not called when next_entry() fails before the expr loop.

Signed-off-by: Namhyung Kim <[email protected]>
Signed-off-by: Paul Moore <[email protected]>
Signed-off-by: franciscofranco <[email protected]>
  • Loading branch information
namhyung authored and DerRomtester committed Sep 21, 2016
1 parent 6d43ba6 commit f385633
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/selinux/ss/conditional.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static int cond_read_node(struct policydb *p, struct cond_node *node, void *fp)

rc = next_entry(buf, fp, sizeof(u32) * 2);
if (rc)
return rc;
goto err;

node->cur_state = le32_to_cpu(buf[0]);

Expand Down

0 comments on commit f385633

Please sign in to comment.