[Pkg-telepathy-commits] [telepathy-glib] 93/111: TpContact: mime_file_written: don't leak the file's path

Simon McVittie smcv at debian.org
Wed Mar 19 18:07:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-glib.

commit 362dc49e04dfef23a2aaf4c2db04252a859dadde
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Mon Mar 10 16:57:50 2014 +0000

    TpContact: mime_file_written: don't leak the file's path
    
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=76000
    Reviewed-by: Guillaume Desmottes
---
 telepathy-glib/contact.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c
index 4a77f11..e747e21 100644
--- a/telepathy-glib/contact.c
+++ b/telepathy-glib/contact.c
@@ -2797,21 +2797,23 @@ mime_file_written (GObject *source_object,
   WriteAvatarData *avatar_data = user_data;
   GFile *file = G_FILE (source_object);
   TpContact *self;
+  gchar *path = g_file_get_path (file);
 
   g_assert (file == avatar_data->mime_file);
 
   if (!g_file_replace_contents_finish (file, res, NULL, &error))
     {
-      DEBUG ("Failed to store MIME type in cache (%s): %s",
-          g_file_get_path (file), error->message);
+      DEBUG ("Failed to store MIME type in cache (%s): %s", path,
+          error->message);
       g_clear_error (&error);
     }
   else
     {
-      DEBUG ("Contact avatar MIME type stored in cache: %s",
-          g_file_get_path (file));
+      DEBUG ("Contact avatar MIME type stored in cache: %s", path);
     }
 
+  g_free (path);
+
   self = g_weak_ref_get (&avatar_data->contact);
 
   if (self == NULL)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-glib.git



More information about the Pkg-telepathy-commits mailing list