]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - audiod.c
audiod: Fix a memory leak.
[paraslash.git] / audiod.c
index 397ef9a257ed89743ca651eed797890966d59a2a..dd723233c75e481f3c0e342c1f4eb993a448c076 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -168,14 +168,14 @@ void para_log(int ll, const char* fmt,...)
 
 static char *configfile_exists(void)
 {
-       static char *config_file;
-
-       if (!config_file) {
-               char *home = para_homedir();
-               config_file = make_message("%s/.paraslash/audiod.conf", home);
-               free(home);
-       }
-       return file_exists(config_file)? config_file : NULL;
+       char *home = para_homedir();
+       char *config_file = make_message("%s/.paraslash/audiod.conf",
+               home);
+       free(home);
+       if (file_exists(config_file))
+               return config_file;
+       free(config_file);
+       return NULL;
 }
 
 static void setup_signal_handling(void)