From d870015bff4eb8f34f465f4c45d91ca326f52a43 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Mon, 9 Apr 2012 11:42:08 -0400 Subject: udisks2: Fix some memory leaks https://bugzilla.redhat.com/show_bug.cgi?id=790062 This was done using the following rather simple script #!/bin/bash while true; do losetup -f /home/davidz/Downloads/Fedora-16-x86_64-Live-Desktop.iso losetup -D done and then running it as root. Signed-off-by: David Zeuthen --- monitor/udisks2/gvfsudisks2volumemonitor.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/monitor/udisks2/gvfsudisks2volumemonitor.c b/monitor/udisks2/gvfsudisks2volumemonitor.c index 58d121c8..3d5cbd52 100644 --- a/monitor/udisks2/gvfsudisks2volumemonitor.c +++ b/monitor/udisks2/gvfsudisks2volumemonitor.c @@ -593,6 +593,13 @@ get_mount_point_for_mount (GUnixMountEntry *mount_entry) } out: + for (l = mount_points; l != NULL; l = l->next) + { + GUnixMountPoint *mount_point = l->data; + if (G_LIKELY (mount_point != ret)) + g_unix_mount_point_free (mount_point); + } + g_list_free (mount_points); return ret; } @@ -700,6 +707,7 @@ should_include_mount (GVfsUDisks2VolumeMonitor *monitor, if (mount_point != NULL) { ret = should_include_mount_point (monitor, mount_point); + g_unix_mount_point_free (mount_point); goto out; } @@ -1500,6 +1508,7 @@ update_fstab_volumes (GVfsUDisks2VolumeMonitor *monitor, !mount_point_has_device (monitor, mount_point)) { new_mount_points = g_list_remove_link (new_mount_points, l); + g_unix_mount_point_free (mount_point); } } -- cgit v1.2.1