Re: [PATCH] Don't leak mountable_name in daemon



Hey Dmitry,

thanks for your patch, it looks good to me! However preferred way for contributing patches in Gnome projects 
is over bugzilla. Could you file a new bug on bugzilla.gnome.org and attach the patch formated by "git 
format-patch" please?

Thanks

Ondrej

----- Original Message -----
If the daemon code allocates a unique mountable_name, later this string
is lost. Store and free it properly to remove the memory leak.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov gmail com>
---
 daemon/daemon-main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/daemon/daemon-main.c b/daemon/daemon-main.c
index dd7fdf8..600921c 100644
--- a/daemon/daemon-main.c
+++ b/daemon/daemon-main.c
@@ -381,11 +381,11 @@ daemon_main (int argc,
   name_owner_id = 0;
   /* We want to own *some* name on the org.gtk.vfs.* namespace so that
      filtering for us works from a sandbox */
-  if (mountable_name == NULL)
-    mountable_name = g_strdup_printf ("org.gtk.vfs.mountpoint_%d", getpid
());
+  if (data->mountable_name == NULL)
+    data->mountable_name = g_strdup_printf ("org.gtk.vfs.mountpoint_%d",
getpid ());
 
   name_owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
-                                  mountable_name,
+                                  data->mountable_name,
                                   G_BUS_NAME_OWNER_FLAGS_NONE,
                                   NULL,
                                   on_name_acquired,
--
2.6.2

_______________________________________________
gvfs-list mailing list
gvfs-list gnome org
https://mail.gnome.org/mailman/listinfo/gvfs-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]