projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
audioc: Fix memory leak in configfile_exists().
[paraslash.git]
/
audioc.c
diff --git
a/audioc.c
b/audioc.c
index 64152ce09323bc9b458f38ff09272f94e949db38..0c0eea47985f7cd0343ea791709895b25c15d940 100644
(file)
--- a/
audioc.c
+++ b/
audioc.c
@@
-253,16
+253,15
@@
__noreturn static void print_completions(void)
static char *configfile_exists(void)
{
static char *configfile_exists(void)
{
-
static
char *config_file;
+ char *config_file;
struct stat statbuf;
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;
if (!stat(config_file, &statbuf))
return config_file;
+ free(config_file);
return NULL;
}
return NULL;
}