summaryrefslogtreecommitdiff
path: root/src/confmisc.c
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2001-12-15 19:50:36 +0000
committerJaroslav Kysela <perex@perex.cz>2001-12-15 19:50:36 +0000
commit9a6902d8a4c2e1bf5041817a82e81c0086f18dc6 (patch)
tree354af92d49f93c313bf7e9326a9f44354014c3db /src/confmisc.c
parent6113d83e089727940eb6136c26794062685bcc47 (diff)
Added snd_config_update_free_global().
Added snd_config_delete_compound_members(). 'const' changes. Fixed memory leaks.
Diffstat (limited to 'src/confmisc.c')
-rw-r--r--src/confmisc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/confmisc.c b/src/confmisc.c
index 30e4207e..0afecab9 100644
--- a/src/confmisc.c
+++ b/src/confmisc.c
@@ -105,7 +105,7 @@ int snd_config_get_bool_ascii(const char *ascii)
* \param conf The configuration node to be parsed
* \return a positive value when success otherwise a negative error number
*/
-int snd_config_get_bool(snd_config_t *conf)
+int snd_config_get_bool(const snd_config_t *conf)
{
long v;
const char *str, *id;
@@ -162,7 +162,7 @@ int snd_config_get_ctl_iface_ascii(const char *ascii)
* \param conf The configuration node to be parsed
* \return a positive value when success otherwise a negative error number
*/
-int snd_config_get_ctl_iface(snd_config_t *conf)
+int snd_config_get_ctl_iface(const snd_config_t *conf)
{
long v;
const char *str, *id;
@@ -325,11 +325,16 @@ int snd_func_igetenv(snd_config_t **dst, snd_config_t *root, snd_config_t *src,
if (err < 0)
return err;
err = snd_config_get_string(d, &str);
- if (err < 0)
+ if (err < 0) {
+ snd_config_delete(d);
return err;
+ }
err = safe_strtol(str, &v);
- if (err < 0)
- return err;;
+ if (err < 0) {
+ snd_config_delete(d);
+ return err;
+ }
+ snd_config_delete(d);
err = snd_config_get_id(src, &id);
if (err < 0)
return err;