gnome-commander r1482 - in branches/gcmd-1-3: . src/tags



Author: epiotr
Date: Tue Jan  8 21:51:49 2008
New Revision: 1482
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1482&view=rev

Log:
Fix for memory leak in tag handling

Modified:
   branches/gcmd-1-3/ChangeLog
   branches/gcmd-1-3/src/tags/gnome-cmd-tags-doc.cc
   branches/gcmd-1-3/src/tags/gnome-cmd-tags-exiv2.cc

Modified: branches/gcmd-1-3/src/tags/gnome-cmd-tags-doc.cc
==============================================================================
--- branches/gcmd-1-3/src/tags/gnome-cmd-tags-doc.cc	(original)
+++ branches/gcmd-1-3/src/tags/gnome-cmd-tags-doc.cc	Tue Jan  8 21:51:49 2008
@@ -469,7 +469,7 @@
     if (!gnome_cmd_file_is_local(finfo))  return;
 
     GError *err = NULL;
-    const gchar *fname = gnome_cmd_file_get_real_path(finfo);
+    gchar *fname = gnome_cmd_file_get_real_path(finfo);
 
     DEBUG('t', "Loading doc metadata for '%s'\n", fname);
 
@@ -482,9 +482,12 @@
         g_return_if_fail (err != NULL);
         g_warning ("'%s' error: %s", fname, err->message);
         g_error_free (err);
+        g_free (fname);
         return;
     }
 
+    g_free (fname);
+
     GsfInfile *infile = NULL;
 
     if ((infile = gsf_infile_msole_new (input, NULL)))

Modified: branches/gcmd-1-3/src/tags/gnome-cmd-tags-exiv2.cc
==============================================================================
--- branches/gcmd-1-3/src/tags/gnome-cmd-tags-exiv2.cc	(original)
+++ branches/gcmd-1-3/src/tags/gnome-cmd-tags-exiv2.cc	Tue Jan  8 21:51:49 2008
@@ -388,7 +388,7 @@
 
     if (!gnome_cmd_file_is_local(finfo))  return;
 
-    const gchar *fname = gnome_cmd_file_get_real_path(finfo);
+    gchar *fname = gnome_cmd_file_get_real_path(finfo);
 
     DEBUG('t', "Loading image metadata for '%s'\n", fname);
 
@@ -411,6 +411,8 @@
     gint width, height;
     GdkPixbufFormat *fmt = gdk_pixbuf_get_file_info (fname, &width, &height);
 
+    g_free (fname);
+
     if (!fmt)
         return;
 



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