[geany/geany] 7fe549: Make sure not to leak tmp_errfile if only outf creation fails

Jiří Techet git-noreply at xxxxx
Fri Jun 10 21:57:34 UTC 2016


Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Fri, 06 May 2016 19:47:04 UTC
Commit:      7fe549d4803442ef0efa71deb04d759cfcda2013
             https://github.com/geany/geany/commit/7fe549d4803442ef0efa71deb04d759cfcda2013

Log Message:
-----------
Make sure not to leak tmp_errfile if only outf creation fails


Modified Paths:
--------------
    tagmanager/src/tm_workspace.c

Modified: tagmanager/src/tm_workspace.c
4 lines changed, 3 insertions(+), 1 deletions(-)
===================================================================
@@ -553,12 +553,14 @@ static gchar *pre_process_file(const gchar *cmd, const gchar *inf)
 {
 	gint ret;
 	gchar *outf = create_temp_file("tmp_XXXXXX.cpp");
-	gchar *tmp_errfile = create_temp_file("tmp_XXXXXX");
+	gchar *tmp_errfile;
 	gchar *errors = NULL;
 	gchar *command;
 
 	if (!outf)
 		return NULL;
+
+	tmp_errfile = create_temp_file("tmp_XXXXXX");
 	if (!tmp_errfile)
 	{
 		g_unlink(outf);



--------------
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