glib r6355 - trunk/gio



Author: alexl
Date: Tue Jan 22 14:15:51 2008
New Revision: 6355
URL: http://svn.gnome.org/viewvc/glib?rev=6355&view=rev

Log:
2008-01-22  Alexander Larsson  <alexl redhat com>

        * gdesktopappinfo.c:
        (g_desktop_app_info_new_from_filename):
	Don't leak GKeyFile




Modified:
   trunk/gio/ChangeLog
   trunk/gio/gdesktopappinfo.c

Modified: trunk/gio/gdesktopappinfo.c
==============================================================================
--- trunk/gio/gdesktopappinfo.c	(original)
+++ trunk/gio/gdesktopappinfo.c	Tue Jan 22 14:15:51 2008
@@ -186,12 +186,16 @@
 				  filename,
 				  G_KEY_FILE_NONE,
 				  NULL))
-    return NULL;
+    {
+      g_key_file_free (key_file);
+      return NULL;
+    }
 
   start_group = g_key_file_get_start_group (key_file);
   if (start_group == NULL || strcmp (start_group, G_KEY_FILE_DESKTOP_GROUP) != 0)
     {
       g_free (start_group);
+      g_key_file_free (key_file);
       return NULL;
     }
   g_free (start_group);
@@ -203,6 +207,7 @@
   if (type == NULL || strcmp (type, G_KEY_FILE_DESKTOP_TYPE_APPLICATION) != 0)
     {
       g_free (type);
+      g_key_file_free (key_file);
       return NULL;
     }
   g_free (type);
@@ -218,6 +223,7 @@
       if (t == NULL)
 	{
 	  g_free (try_exec);
+	  g_key_file_free (key_file);
 	  return NULL;
 	}
       g_free (t);
@@ -239,6 +245,8 @@
   info->startup_notify = g_key_file_get_boolean (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY, NULL) != FALSE;
   info->hidden = g_key_file_get_boolean (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_HIDDEN, NULL) != FALSE;
 
+  g_key_file_free (key_file);
+  
   info->icon = NULL;
   if (info->icon_name)
     {



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