fix leak that occurs when multiple mount entries match the requested path
authorRyan Lortie <desrt@desrt.ca>
Fri, 12 Dec 2008 20:03:36 +0000 (20:03 +0000)
committerRyan Lortie <ryanl@src.gnome.org>
Fri, 12 Dec 2008 20:03:36 +0000 (20:03 +0000)
2008-12-12  Ryan Lortie  <desrt@desrt.ca>

        * gio/gunixmounts.c (g_unix_mount_at): fix leak that occurs when
        multiple mount entries match the requested path

svn path=/trunk/; revision=7742

ChangeLog
gio/gunixmounts.c

index e4fd0e2..0a20537 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-12-12  Ryan Lortie  <desrt@desrt.ca>
+
+       * gio/gunixmounts.c (g_unix_mount_at): fix leak that occurs when
+       multiple mount entries match the requested path
+
 2008-12-12  Behdad Esfahbod  <behdad@gnome.org>
 
        * glib/guniprop.c: Improve g_unichar_iswide_cjk() docs.
index 6b95d74..87efce4 100644 (file)
@@ -1054,7 +1054,7 @@ g_unix_mount_at (const char *mount_path,
     {
       mount_entry = l->data;
 
-      if (strcmp (mount_path, mount_entry->mount_path) == 0)
+      if (!found && strcmp (mount_path, mount_entry->mount_path) == 0)
        found = mount_entry;
       else
        g_unix_mount_free (mount_entry);