static char *configfile_exists(void)
{
- static char *config_file;
+ char *config_file;
struct stat statbuf;
+ char *home = para_homedir();
- if (!config_file) {
- char *home = para_homedir();
- config_file = make_message("%s/.paraslash/audioc.conf", home);
- free(home);
- }
+ config_file = make_message("%s/.paraslash/audioc.conf", home);
+ free(home);
if (!stat(config_file, &statbuf))
return config_file;
+ free(config_file);
return NULL;
}
int main(int argc, char *argv[])
{
int ret = -E_AUDIOC_SYNTAX, fd;
- char *cf, *buf = NULL, *args;
+ char *cf, *buf = NULL, *args = NULL;
size_t bufsize;
if (audioc_cmdline_parser(argc, argv, &conf))
} while (ret >= 0);
out:
free(buf);
+ free(args);
if (ret < 0)
PARA_ERROR_LOG("%s\n", para_strerror(-ret));
return ret < 0? EXIT_FAILURE : EXIT_SUCCESS;