[libpeas] Fix memory leak in PeasPluginInfo



commit b5c07d76d7eb2616e508561ae4a5780ba728c386
Author: Garrett Regier <alias301 gmail com>
Date:   Sun Jan 16 12:37:53 2011 -0800

    Fix memory leak in PeasPluginInfo

 libpeas/peas-plugin-info.c |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/libpeas/peas-plugin-info.c b/libpeas/peas-plugin-info.c
index 316776d..4cfb1d4 100644
--- a/libpeas/peas-plugin-info.c
+++ b/libpeas/peas-plugin-info.c
@@ -236,6 +236,17 @@ _peas_plugin_info_new (const gchar *filename,
       goto error;
     }
 
+  /* Get Name */
+  str = g_key_file_get_locale_string (plugin_file, "Plugin",
+                                      "Name", NULL, NULL);
+  if (str)
+    info->name = str;
+  else
+    {
+      g_warning ("Could not find 'Name' in '%s'", filename);
+      goto error;
+    }
+
   /* Get the dependency list */
   info->dependencies = g_key_file_get_string_list (plugin_file,
                                                    "Plugin",
@@ -256,17 +267,6 @@ _peas_plugin_info_new (const gchar *filename,
       info->loader = g_strdup ("C");
     }
 
-  /* Get Name */
-  str = g_key_file_get_locale_string (plugin_file, "Plugin",
-                                      "Name", NULL, NULL);
-  if (str)
-    info->name = str;
-  else
-    {
-      g_warning ("Could not find 'Name' in '%s'", filename);
-      goto error;
-    }
-
   /* Get Description */
   str = g_key_file_get_locale_string (plugin_file, "Plugin",
                                       "Description", NULL, NULL);
@@ -336,7 +336,6 @@ error:
   g_free (info->file);
   g_free (info->module_name);
   g_free (info->name);
-  g_free (info->loader);
   g_free (info);
   g_key_file_free (plugin_file);
 



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