diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-07-21 20:18:32 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-07-22 12:07:47 -0400 |
commit | d89a8483db35771a92804c6a4624c8cc791131ec (patch) | |
tree | d95c2cff47ee2aaf071b5f6754cd05b6ccce7288 | |
parent | 5d61707a332e9fb9a71b9b7ceaa0376bf32a343d (diff) | |
download | gvfs-d89a8483db35771a92804c6a4624c8cc791131ec.tar.gz |
proxy volume monitor: Plug a memory leak
valgrind pointed out a leak here, and indeed, g_mount_get_root()
is documented as transfer full, so we should unref the GFile
when we are done with it.
https://bugzilla.gnome.org/show_bug.cgi?id=752689
-rw-r--r-- | monitor/proxy/gproxyvolume.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/monitor/proxy/gproxyvolume.c b/monitor/proxy/gproxyvolume.c index f0cfa116..fc24f15f 100644 --- a/monitor/proxy/gproxyvolume.c +++ b/monitor/proxy/gproxyvolume.c @@ -258,13 +258,16 @@ update_shadow_mount (GProxyVolume *volume) { GMount *mount = G_MOUNT (l->data); GFile *mount_root; + gboolean prefix_matches; /* don't consider our (possibly) existing shadow mount */ if (G_IS_PROXY_SHADOW_MOUNT (mount)) continue; mount_root = g_mount_get_root (mount); - if (g_file_has_prefix (activation_root, mount_root)) + prefix_matches = g_file_has_prefix (activation_root, mount_root); + g_object_unref (mount_root); + if (prefix_matches) { mount_to_shadow = g_object_ref (mount); break; |