Fix memory leak in audioc.c.
authorAndre Noll <maan@systemlinux.org>
Fri, 13 Jan 2012 22:38:14 +0000 (23:38 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 5 Feb 2012 19:14:44 +0000 (20:14 +0100)
We leak cf which is allocated and returned by configfile_exists().

audioc.c

index 7435a86..1baa6c3 100644 (file)
--- a/audioc.c
+++ b/audioc.c
@@ -298,7 +298,9 @@ int main(int argc, char *argv[])
                        .check_required = 0,
                        .check_ambiguity = 0
                };
-               if (audioc_cmdline_parser_config_file(cf, &conf, &params)) {
+               ret = audioc_cmdline_parser_config_file(cf, &conf, &params);
+               free(cf);
+               if (ret) {
                        fprintf(stderr, "parse error in config file\n");
                        exit(EXIT_FAILURE);
                }