Message ID | 20200107151810.pzthoz3w2y3wqae7@spacedout.fries.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | mixer: Fix memory leak for more than 16 file descriptor case | expand |
On Tue, 07 Jan 2020 16:18:10 +0100, David Fries wrote: > > Signed-off-by: David Fries <David@Fries.net> > Reviewed-by: Takashi Iwai <tiwai@suse.de> Applied now. Thanks. Takashi
diff --git a/src/mixer/mixer.c b/src/mixer/mixer.c index 82056474..b1af9945 100644 --- a/src/mixer/mixer.c +++ b/src/mixer/mixer.c @@ -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,