[geany/geany] b2f471: Plug a memory leak on Windows

Colomban Wendling git-noreply at xxxxx
Sun Nov 3 22:35:55 UTC 2013


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sun, 03 Nov 2013 22:35:55 UTC
Commit:      b2f4717ad301777ca9cfb77fca38f4dc8d3d90a6
             https://github.com/geany/geany/commit/b2f4717ad301777ca9cfb77fca38f4dc8d3d90a6

Log Message:
-----------
Plug a memory leak on Windows


Modified Paths:
--------------
    src/build.c

Modified: src/build.c
9 files changed, 3 insertions(+), 6 deletions(-)
===================================================================
@@ -771,7 +771,6 @@ static GPid build_spawn_cmd(GeanyDocument *doc, const gchar *cmd, const gchar *d
 	gchar **argv;
 	gchar *working_dir;
 	gchar *utf8_working_dir;
-	gchar *cmd_string;
 	gchar *utf8_cmd_string;
 #ifdef SYNC_SPAWN
 	gchar *output[2];
@@ -791,19 +790,17 @@ static GPid build_spawn_cmd(GeanyDocument *doc, const gchar *cmd, const gchar *d
 	clear_all_errors();
 	SETPTR(current_dir_entered, NULL);
 
-	cmd_string = g_strdup(cmd);
-
 #ifdef G_OS_WIN32
-	argv = g_strsplit(cmd_string, " ", 0);
+	argv = g_strsplit(cmd, " ", 0);
 #else
 	argv = g_new0(gchar *, 4);
 	argv[0] = g_strdup("/bin/sh");
 	argv[1] = g_strdup("-c");
-	argv[2] = cmd_string;
+	argv[2] = g_strdup(cmd);
 	argv[3] = NULL;
 #endif
 
-	utf8_cmd_string = utils_get_utf8_from_locale(cmd_string);
+	utf8_cmd_string = utils_get_utf8_from_locale(cmd);
 	utf8_working_dir = !EMPTY(dir) ? g_strdup(dir) : g_path_get_dirname(doc->file_name);
 	working_dir = utils_get_locale_from_utf8(utf8_working_dir);
 



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list