mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
control_hw: fix potential memory leak
Signed-off-by: Ivan Sorokin <vanyacpp@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
3baf1bee84
commit
336dc58beb
1 changed files with 3 additions and 1 deletions
|
|
@ -240,8 +240,10 @@ static int snd_ctl_hw_elem_tlv(snd_ctl_t *handle, int op_flag,
|
|||
return -errno;
|
||||
}
|
||||
if (op_flag == 0) {
|
||||
if (xtlv->tlv[1] + 2 * sizeof(unsigned int) > tlv_size)
|
||||
if (xtlv->tlv[1] + 2 * sizeof(unsigned int) > tlv_size) {
|
||||
free(xtlv);
|
||||
return -EFAULT;
|
||||
}
|
||||
memcpy(tlv, xtlv->tlv, xtlv->tlv[1] + 2 * sizeof(unsigned int));
|
||||
}
|
||||
free(xtlv);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue