mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-25 02:36:07 +00:00
file: Fix reference leak
We are missing a "nautilus_file_unref(parent);" statement is missing in the get_filesystem_remote() method, leaking a reference. This was detected by a failing self-check test in a branch: https://gitlab.gnome.org/GNOME/nautilus/-/jobs/720894 Let's fix this with autocleanup. For consistency, change the neighboor get_filesystem_type() to use autocleanup too, instead of the explicit nautilus_file_unref().
This commit is contained in:
parent
6cb1715c77
commit
9ef5d8344b
|
@ -4664,7 +4664,6 @@ nautilus_file_get_filesystem_use_preview (NautilusFile *file)
|
|||
char *
|
||||
nautilus_file_get_filesystem_type (NautilusFile *file)
|
||||
{
|
||||
NautilusFile *parent;
|
||||
char *filesystem_type = NULL;
|
||||
|
||||
g_assert (NAUTILUS_IS_FILE (file));
|
||||
|
@ -4675,11 +4674,12 @@ nautilus_file_get_filesystem_type (NautilusFile *file)
|
|||
}
|
||||
else
|
||||
{
|
||||
g_autoptr (NautilusFile) parent = NULL;
|
||||
|
||||
parent = nautilus_file_get_parent (file);
|
||||
if (parent != NULL)
|
||||
{
|
||||
filesystem_type = g_strdup (parent->details->filesystem_type);
|
||||
nautilus_file_unref (parent);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4689,8 +4689,6 @@ nautilus_file_get_filesystem_type (NautilusFile *file)
|
|||
gboolean
|
||||
nautilus_file_get_filesystem_remote (NautilusFile *file)
|
||||
{
|
||||
NautilusFile *parent;
|
||||
|
||||
g_assert (NAUTILUS_IS_FILE (file));
|
||||
|
||||
if (nautilus_file_is_directory (file))
|
||||
|
@ -4699,6 +4697,8 @@ nautilus_file_get_filesystem_remote (NautilusFile *file)
|
|||
}
|
||||
else
|
||||
{
|
||||
g_autoptr (NautilusFile) parent = NULL;
|
||||
|
||||
parent = nautilus_file_get_parent (file);
|
||||
if (parent != NULL)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue