Don't leak resources in error cases

This commit is contained in:
Matthias Clasen 2011-06-14 10:12:46 -04:00
parent 83d34f6309
commit 6ac8e6108c

View File

@ -963,6 +963,7 @@ write_to_temp_file (const gchar *contents,
display_name, display_name,
g_strerror (save_errno)); g_strerror (save_errno));
fclose (file);
g_unlink (tmp_name); g_unlink (tmp_name);
goto out; goto out;
@ -1006,6 +1007,7 @@ write_to_temp_file (const gchar *contents,
display_name, display_name,
g_strerror (save_errno)); g_strerror (save_errno));
fclose (file);
g_unlink (tmp_name); g_unlink (tmp_name);
goto out; goto out;
@ -1026,6 +1028,7 @@ write_to_temp_file (const gchar *contents,
display_name, display_name,
g_strerror (save_errno)); g_strerror (save_errno));
fclose (file);
g_unlink (tmp_name); g_unlink (tmp_name);
goto out; goto out;