mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
- check the return value of malloc & co.
This commit is contained in:
parent
7e6569e300
commit
d91948db49
7 changed files with 42 additions and 0 deletions
|
|
@ -2642,6 +2642,10 @@ static int snd_config_hooks_call(snd_config_t *root, snd_config_t *config, snd_c
|
|||
if (!func_name) {
|
||||
int len = 16 + strlen(str) + 1;
|
||||
buf = malloc(len);
|
||||
if (! buf) {
|
||||
err = -ENOMEM;
|
||||
goto _err;
|
||||
}
|
||||
snprintf(buf, len, "snd_config_hook_%s", str);
|
||||
buf[len-1] = '\0';
|
||||
func_name = buf;
|
||||
|
|
@ -3423,6 +3427,10 @@ static int _snd_config_evaluate(snd_config_t *src,
|
|||
if (!func_name) {
|
||||
int len = 9 + strlen(str) + 1;
|
||||
buf = malloc(len);
|
||||
if (! buf) {
|
||||
err = -ENOMEM;
|
||||
goto _err;
|
||||
}
|
||||
snprintf(buf, len, "snd_func_%s", str);
|
||||
buf[len-1] = '\0';
|
||||
func_name = buf;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue