summaryrefslogtreecommitdiff
path: root/alsactl
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2008-08-19 13:28:22 +0200
committerJaroslav Kysela <perex@perex.cz>2008-08-19 13:28:22 +0200
commitcdf5a9b824c01b26285069c2885be986accf50b8 (patch)
tree37a4d16af9ac7775c1d9df4031edb3a68c88c7a9 /alsactl
parent2e7bb3caf53e63a5e16d34234c609ef87c1d085f (diff)
alsactl init - fix memory leaks (valgrind helped)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'alsactl')
-rw-r--r--alsactl/alsactl.c1
-rw-r--r--alsactl/init_parse.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/alsactl/alsactl.c b/alsactl/alsactl.c
index 6c62ffc..6728fbc 100644
--- a/alsactl/alsactl.c
+++ b/alsactl/alsactl.c
@@ -174,5 +174,6 @@ int main(int argc, char *argv[])
res = -ENODEV;
}
+ snd_config_update_free_global();
return res < 0 ? res : 0;
}
diff --git a/alsactl/init_parse.c b/alsactl/init_parse.c
index 57f9a92..ab6a6f9 100644
--- a/alsactl/init_parse.c
+++ b/alsactl/init_parse.c
@@ -124,13 +124,16 @@ static void free_space(struct space *space)
space->ctl_card_info = NULL;
}
if (space->ctl_handle) {
- free(space->ctl_handle);
+ snd_hctl_close(space->ctl_handle);
space->ctl_handle = NULL;
}
if (space->rootdir)
free(space->rootdir);
if (space->program_result)
free(space->program_result);
+ if (space->go_to)
+ free(space->go_to);
+ free(space);
}
struct pair *value_find(struct space *space, const char *key)
@@ -1680,6 +1683,7 @@ static int parse(struct space *space, const char *filename)
linenum += linenum_adj;
}
+ free(line);
space->filename = NULL;
space->linenum = -1;
file_unmap(buf, bufsize);