mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
Check error values
Check error values from some functions which were ignored.
This commit is contained in:
parent
a5831c7300
commit
1fb6e88716
1 changed files with 13 additions and 3 deletions
|
|
@ -268,7 +268,12 @@ int snd_func_getenv(snd_config_t **dst, snd_config_t *root, snd_config_t *src,
|
||||||
}
|
}
|
||||||
if (i == idx) {
|
if (i == idx) {
|
||||||
idx++;
|
idx++;
|
||||||
snd_config_get_string(n, &ptr);
|
err = snd_config_get_string(n, &ptr);
|
||||||
|
if (err < 0) {
|
||||||
|
SNDERR("invalid string for id %s", id);
|
||||||
|
err = -EINVAL;
|
||||||
|
goto __error;
|
||||||
|
}
|
||||||
env = getenv(ptr);
|
env = getenv(ptr);
|
||||||
if (env != NULL && *env != '\0') {
|
if (env != NULL && *env != '\0') {
|
||||||
res = strdup(env);
|
res = strdup(env);
|
||||||
|
|
@ -404,8 +409,13 @@ int snd_func_concat(snd_config_t **dst, snd_config_t *root, snd_config_t *src,
|
||||||
}
|
}
|
||||||
if (i == idx) {
|
if (i == idx) {
|
||||||
idx++;
|
idx++;
|
||||||
snd_config_get_ascii(n, &ptr);
|
err = snd_config_get_ascii(n, &ptr);
|
||||||
len1 = strlen(ptr);
|
if (err < 0) {
|
||||||
|
SNDERR("invalid ascii string for id %s", id);
|
||||||
|
err = -EINVAL;
|
||||||
|
goto __error;
|
||||||
|
}
|
||||||
|
len1 = strlen(ptr);
|
||||||
tmp = realloc(res, len + len1 + 1);
|
tmp = realloc(res, len + len1 + 1);
|
||||||
if (tmp == NULL) {
|
if (tmp == NULL) {
|
||||||
free(ptr);
|
free(ptr);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue