mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-09 13:30:03 -05:00
mixer: Fix memory leak for more than 16 file descriptor case
Signed-off-by: David Fries <David@Fries.net> Reviewed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
b20b400e2f
commit
14ad963e19
1 changed files with 1 additions and 1 deletions
|
|
@ -767,7 +767,7 @@ int snd_mixer_wait(snd_mixer_t *mixer, int timeout)
|
|||
if (count < 0)
|
||||
return count;
|
||||
if ((unsigned int) count > sizeof(spfds) / sizeof(spfds[0])) {
|
||||
pfds = malloc(count * sizeof(*pfds));
|
||||
pfds = alloca(count * sizeof(*pfds));
|
||||
if (!pfds)
|
||||
return -ENOMEM;
|
||||
err = snd_mixer_poll_descriptors(mixer, pfds,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue