app: don't leak the GFileInfo in file_open_image() and file_save()

This commit is contained in:
Michael Natterer 2014-10-07 15:23:19 +02:00
parent cd505dbd02
commit ba065a31ec
2 changed files with 8 additions and 0 deletions

View file

@ -132,6 +132,7 @@ file_open_image (Gimp *gimp,
{
g_set_error_literal (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Not a regular file"));
g_object_unref (info);
return NULL;
}
@ -140,8 +141,11 @@ file_open_image (Gimp *gimp,
{
g_set_error_literal (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Premission denied"));
g_object_unref (info);
return NULL;
}
g_object_unref (info);
}
if (! g_file_is_native (file) &&

View file

@ -113,6 +113,7 @@ file_save (Gimp *gimp,
{
g_set_error_literal (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Not a regular file"));
g_object_unref (info);
goto out;
}
@ -121,8 +122,11 @@ file_save (Gimp *gimp,
{
g_set_error_literal (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Permission denied"));
g_object_unref (info);
goto out;
}
g_object_unref (info);
}
if (! g_file_is_native (file) &&