Make sure not to leak tmp_errfile if only outf creation fails

This commit is contained in:
Jiří Techet 2016-05-06 21:47:04 +02:00
parent 084c23bbb1
commit 7fe549d480

View File

@ -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);