Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Sun, 19 Oct 2014 18:39:53 UTC Commit: 97a28f3e0cd5afe179f6c5569ce1b5f9a8563dac https://github.com/geany/geany-plugins/commit/97a28f3e0cd5afe179f6c5569ce1b5...
Log Message: ----------- geanyctags: fix memory leak
Thanks to Colomban for noticing
Modified Paths: -------------- geanyctags/src/geanyctags.c
Modified: geanyctags/src/geanyctags.c 16 lines changed, 9 insertions(+), 7 deletions(-) =================================================================== @@ -113,7 +113,7 @@ static void spawn_cmd(const gchar *cmd, const gchar *dir) gchar *working_dir; gchar *utf8_working_dir; gchar *utf8_cmd_string; - gchar *out, *err; + gchar *out; gint exitcode; gboolean success;
@@ -141,10 +141,12 @@ static void spawn_cmd(const gchar *cmd, const gchar *dir) g_free(utf8_working_dir); g_free(utf8_cmd_string); +#ifndef G_OS_WIN32 + success = utils_spawn_sync(working_dir, argv, NULL, G_SPAWN_SEARCH_PATH, + NULL, NULL, NULL, &out, &exitcode, &error); +#else success = utils_spawn_sync(working_dir, argv, NULL, G_SPAWN_SEARCH_PATH, - NULL, NULL, &out, &err, &exitcode, &error); -#ifdef G_OS_WIN32 - err = out; + NULL, NULL, &out, NULL, &exitcode, &error); #endif if (!success || exitcode != 0) { @@ -153,16 +155,16 @@ static void spawn_cmd(const gchar *cmd, const gchar *dir) msgwin_msg_add(COLOR_RED, -1, NULL, _("Process execution failed (%s)"), error->message); g_error_free(error); } - msgwin_msg_add(COLOR_RED, -1, NULL, "%s", err); + msgwin_msg_add(COLOR_RED, -1, NULL, "%s", out); } else { - msgwin_msg_add(COLOR_BLACK, -1, NULL, "%s", err); + msgwin_msg_add(COLOR_BLACK, -1, NULL, "%s", out); }
g_strfreev(argv); g_free(working_dir); - g_free(err); + g_free(out); }
static gchar *get_tags_filename()
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).