mirror of https://github.com/GNOME/gimp.git
plug-ins: The plugin can leak the "tif" file descriptor as written...
... and also doesn't write out all the data, if it does a "goto out" for any reason. A leaked file descriptor can prevent a file from being renamed or deleted on Windows. See also #3740. Reviewer note (Jehan): this may not be the main issue as reporters were not writing about export failure. So there is probably another case even when the plug-in successfully wrote the TIFF image.
This commit is contained in:
parent
9f385b287f
commit
fe340c822a
|
@ -947,7 +947,7 @@ save_image (GFile *file,
|
|||
GimpMetadata *metadata,
|
||||
GError **error)
|
||||
{
|
||||
TIFF *tif;
|
||||
TIFF *tif = NULL;
|
||||
const Babl *space = NULL;
|
||||
gboolean status = FALSE;
|
||||
gboolean out_linear = FALSE;
|
||||
|
@ -1133,6 +1133,9 @@ save_image (GFile *file,
|
|||
}
|
||||
}
|
||||
|
||||
status = TRUE;
|
||||
|
||||
out:
|
||||
/* close the file for good */
|
||||
if (tif)
|
||||
{
|
||||
|
@ -1142,9 +1145,6 @@ save_image (GFile *file,
|
|||
|
||||
gimp_progress_update (1.0);
|
||||
|
||||
status = TRUE;
|
||||
|
||||
out:
|
||||
g_list_free (layers);
|
||||
return status;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue