Skip to content

Commit

Permalink
ucm: fix use-after-free in parse_component_seq()
Browse files Browse the repository at this point in the history
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
  • Loading branch information
perexg committed Jun 8, 2020
1 parent 141acab commit 6eb78d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ucm/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,11 +617,12 @@ static int parse_component_seq(snd_use_case_mgr_t *uc_mgr,
return err;

cmpt_seq->device = find_component_dev(uc_mgr, val);
free(val);
if (!cmpt_seq->device) {
uc_error("error: Cannot find component device %s", val);
free(val);
return -EINVAL;
}
free(val);

/* Parent needs its enable or disable sequence */
cmpt_seq->enable = enable;
Expand Down

0 comments on commit 6eb78d4

Please sign in to comment.