- check the return value of malloc & co.

This commit is contained in:
Takashi Iwai 2004-02-25 11:24:29 +00:00
parent 7e6569e300
commit d91948db49
7 changed files with 42 additions and 0 deletions

View file

@ -923,6 +923,8 @@ int snd_pcm_direct_parse_bindings(snd_pcm_direct_t *dmix, snd_config_t *cfg)
return -EINVAL;
}
dmix->bindings = malloc(count * sizeof(unsigned int));
if (dmix->bindings == NULL)
return -ENOMEM;
for (chn = 0; chn < count; chn++)
dmix->bindings[chn] = UINT_MAX; /* don't route */
snd_config_for_each(i, next, cfg) {