glib r7521 - branches/glib-2-18/gio



Author: matthiasc
Date: Sun Sep 21 00:04:37 2008
New Revision: 7521
URL: http://svn.gnome.org/viewvc/glib?rev=7521&view=rev

Log:
Plug  a memory leak


Modified:
   branches/glib-2-18/gio/ChangeLog
   branches/glib-2-18/gio/gdesktopappinfo.c

Modified: branches/glib-2-18/gio/gdesktopappinfo.c
==============================================================================
--- branches/glib-2-18/gio/gdesktopappinfo.c	(original)
+++ branches/glib-2-18/gio/gdesktopappinfo.c	Sun Sep 21 00:04:37 2008
@@ -480,7 +480,7 @@
 {
   GFile *file;
   char *result = NULL;
-  char *path;
+  char *path, *name;
 
   file = g_file_new_for_uri (uri);
   path = g_file_get_path (file);
@@ -500,12 +500,20 @@
     case 'd':
     case 'D':
       if (path)
-	result = g_shell_quote (g_path_get_dirname (path));
+        {
+          name = g_path_get_dirname (path);
+	  result = g_shell_quote (name);
+          g_free (name);
+        }
       break;
     case 'n':
     case 'N':
       if (path)
-	result = g_shell_quote (g_path_get_basename (path));
+        {
+          name = g_path_get_basename (path);
+	  result = g_shell_quote (name);
+          g_free (name);
+        }
       break;
     }
 



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