diff options
author | Denis Krjuchkov <denis@crazydev.net> | 2012-10-17 23:47:21 +0600 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-03 19:45:51 +0100 |
commit | 01a45a53aa93977903cf467ccd54c16956b50bdb (patch) | |
tree | b4be379eddddf77c31ff7913d36a196050dd7e4c /src | |
parent | a9a5907a0ffe67c5da9bc34d615ab4aa8d7ba4fa (diff) | |
download | mpd-01a45a53aa93977903cf467ccd54c16956b50bdb.tar.gz mpd-01a45a53aa93977903cf467ccd54c16956b50bdb.tar.xz mpd-01a45a53aa93977903cf467ccd54c16956b50bdb.zip |
cmdline: bunch of fixes related to config file selection
- fix potential memory leak of system_path
'Potential' because currently g_get_system_config_dirs()
returns single entry on Windows, but that might change.
- remove incorrect g_free() call
It's not required at all because
g_get_system_config_dirs() returns GLib owned memory.
- remove extra semicolon
Diffstat (limited to 'src')
-rw-r--r-- | src/cmdline.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmdline.c b/src/cmdline.c index a972daf95..cb7eff36a 100644 --- a/src/cmdline.c +++ b/src/cmdline.c @@ -213,12 +213,12 @@ parse_cmdline(int argc, char **argv, struct options *options, if(g_file_test(system_path, G_FILE_TEST_IS_REGULAR)) { ret = config_read_file(system_path,error_r); + g_free(system_path); break; - } - ++i;; + } else + g_free(system_path); + ++i; } - g_free(system_path); - g_free(&system_config_dirs); } #else /* G_OS_WIN32 */ char *path2; |