test/chmap: Fix wrong malloc size

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2012-09-13 08:06:26 +02:00
parent 2c61a4173f
commit 58c45b3030

View file

@ -118,7 +118,7 @@ static int set_chmap(snd_pcm_t *pcm, int format, int channels, int rate,
}
if (setup_pcm(pcm, format, channels, rate))
return 1;
map = malloc(sizeof(int) * channels + 1);
map = malloc(sizeof(int) * (channels + 1));
if (!map) {
printf("cannot malloc\n");
return 1;