[geany/geany] 7b2f39: Remove an unused variable and plug a theoretical memory leak

Colomban Wendling git-noreply at xxxxx
Mon Nov 4 15:05:25 UTC 2013


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Mon, 04 Nov 2013 15:05:25 UTC
Commit:      7b2f39a852bc29feb196710d5752faae70a50832
             https://github.com/geany/geany/commit/7b2f39a852bc29feb196710d5752faae70a50832

Log Message:
-----------
Remove an unused variable and plug a theoretical memory leak


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

Modified: src/build.c
6 files changed, 3 insertions(+), 3 deletions(-)
===================================================================
@@ -866,7 +866,6 @@ static GPid build_spawn_cmd(GeanyDocument *doc, const gchar *cmd, const gchar *d
 static gchar *prepare_run_script(GeanyDocument *doc, gchar **vte_cmd_nonscript, guint cmdindex)
 {
 	GeanyBuildCommand *cmd = NULL;
-	gchar *executable = NULL;
 	gchar *working_dir = NULL;
 	const gchar *cmd_working_dir;
 	gboolean autoclose = FALSE;
@@ -905,8 +904,9 @@ static gchar *prepare_run_script(GeanyDocument *doc, gchar **vte_cmd_nonscript,
 		{
 			if (vte_cmd_nonscript != NULL)
 				*vte_cmd_nonscript = cmd_string;
+			else
+				g_free(cmd_string);
 
-			utils_free_pointers(1, executable, NULL);
 			return working_dir;
 		}
 		else
@@ -926,7 +926,7 @@ static gchar *prepare_run_script(GeanyDocument *doc, gchar **vte_cmd_nonscript,
 		g_error_free(error);
 	}
 
-	utils_free_pointers(3, cmd_string, tmp, executable, NULL);
+	utils_free_pointers(2, cmd_string, tmp, NULL);
 
 	if (result)
 		return 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