Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Sun, 03 Nov 2013 21:30:55 UTC Commit: cb588a1b82d0e85c0cdb9e422d073b4dc9b04a30 https://github.com/geany/geany/commit/cb588a1b82d0e85c0cdb9e422d073b4dc9b04a...
Log Message: ----------- Plug a possible memory leak
Modified Paths: -------------- src/main.c
Modified: src/main.c 11 files changed, 7 insertions(+), 4 deletions(-) =================================================================== @@ -647,10 +647,9 @@ static void parse_command_line_options(gint *argc, gchar ***argv) static gint create_config_dir(void) { gint saved_errno = 0; - gchar *conf_file = g_build_filename(app->configdir, "geany.conf", NULL); - gchar *filedefs_dir = g_build_filename(app->configdir, GEANY_FILEDEFS_SUBDIR, NULL); - - gchar *templates_dir = g_build_filename(app->configdir, GEANY_TEMPLATES_SUBDIR, NULL); + gchar *conf_file = NULL; + gchar *filedefs_dir = NULL; + gchar *templates_dir = NULL;
if (! g_file_test(app->configdir, G_FILE_TEST_EXISTS)) { @@ -697,6 +696,10 @@ static gint create_config_dir(void) saved_errno = utils_mkdir(app->configdir, TRUE); }
+ conf_file = g_build_filename(app->configdir, "geany.conf", NULL); + filedefs_dir = g_build_filename(app->configdir, GEANY_FILEDEFS_SUBDIR, NULL); + templates_dir = g_build_filename(app->configdir, GEANY_TEMPLATES_SUBDIR, NULL); + if (saved_errno == 0 && ! g_file_test(conf_file, G_FILE_TEST_EXISTS)) { /* check whether geany.conf can be written */ saved_errno = utils_is_file_writable(app->configdir);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).