From 01a45a53aa93977903cf467ccd54c16956b50bdb Mon Sep 17 00:00:00 2001 From: Denis Krjuchkov Date: Wed, 17 Oct 2012 23:47:21 +0600 Subject: 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 --- src/cmdline.c | 8 ++++---- 1 file 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; -- cgit v1.2.3