summaryrefslogtreecommitdiff
path: root/src/confmisc.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-01-21 19:35:26 +0000
committerTakashi Iwai <tiwai@suse.de>2005-01-21 19:35:26 +0000
commit1fb6e88716ef2573f26f85330038c5e76d886b46 (patch)
treee2e930c6be3b5a2191278431cbe84aa6d108e729 /src/confmisc.c
parenta5831c7300414a6368c00a1371fdec5bdd2d6e2f (diff)
Check error values
Check error values from some functions which were ignored.
Diffstat (limited to 'src/confmisc.c')
-rw-r--r--src/confmisc.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/confmisc.c b/src/confmisc.c
index a11326fe..981c9efc 100644
--- a/src/confmisc.c
+++ b/src/confmisc.c
@@ -268,7 +268,12 @@ int snd_func_getenv(snd_config_t **dst, snd_config_t *root, snd_config_t *src,
}
if (i == 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);
if (env != NULL && *env != '\0') {
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) {
idx++;
- snd_config_get_ascii(n, &ptr);
- len1 = strlen(ptr);
+ err = snd_config_get_ascii(n, &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);
if (tmp == NULL) {
free(ptr);