From d20bf1076b25fb436791e4ea9d656a8756d1cf61 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Fri, 21 Nov 2008 00:01:22 +0000 Subject: [PATCH] =?utf8?q?Bug=20561375=20=E2=80=93=20Leaks=20mountpoint=20?= =?utf8?q?description?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2008-11-21 Cosimo Cecchi Bug 561375 – Leaks mountpoint description * glocalfile.c: (get_mount_info): don't leak the mountpoint description string. svn path=/trunk/; revision=7662 --- gio/ChangeLog | 7 +++++++ gio/glocalfile.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index cd0250c..97c3ea6 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,5 +1,12 @@ 2008-11-21 Cosimo Cecchi + Bug 561375 – Leaks mountpoint description + + * glocalfile.c: (get_mount_info): don't leak the mountpoint description + string. + +2008-11-21 Cosimo Cecchi + Bug 561352 – Leak of icon description * gcontenttype.c: (g_content_type_get_icon): don't leak the XDG mimetype diff --git a/gio/glocalfile.c b/gio/glocalfile.c index 9577e72..fb890db 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -779,7 +779,7 @@ get_mount_info (GFileInfo *fs_info, mountpoint = find_mountpoint_for (path, buf.st_dev); if (mountpoint == NULL) - mountpoint = "/"; + mountpoint = g_strdup ("/"); mount = g_unix_mount_at (mountpoint, &cache_time); if (mount) @@ -790,6 +790,8 @@ get_mount_info (GFileInfo *fs_info, g_unix_mount_free (mount); } + g_free (mountpoint); + dev = g_new0 (dev_t, 1); *dev = buf.st_dev; -- 2.7.4