[anjuta] libanjuta: Fix memory corruption in AnjutaPkgConfig (bgo#679827)



commit 53c87106fbf62dffa07f808fed5abc90ec39768e
Author: Johannes Schmid <jhs gnome org>
Date:   Fri Jul 13 19:37:09 2012 +0200

    libanjuta: Fix memory corruption in AnjutaPkgConfig (bgo#679827)

 libanjuta/anjuta-pkg-config.c |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/libanjuta/anjuta-pkg-config.c b/libanjuta/anjuta-pkg-config.c
index 1bbef0d..4e46424 100644
--- a/libanjuta/anjuta-pkg-config.c
+++ b/libanjuta/anjuta-pkg-config.c
@@ -156,30 +156,30 @@ anjuta_pkg_config_ignore_package (const gchar* name)
  */
 gchar* anjuta_pkg_config_get_version (const gchar* package)
 {
-  gchar *cmd;
+	gchar *cmd;
 	gchar *err;
 	gchar *out;
 	gint status;
-  GError* error;
+	GError* error = NULL;
 
 	cmd = g_strdup_printf ("pkg-config --modversion %s", package);
 
 	if (g_spawn_command_line_sync (cmd, &out, &err, &status, &error))
-  {
-    g_free (err);
-    g_free (cmd);
-    return out;
-  }
-  else
-  {
-    g_free (out);
-    g_free (err);
-    g_free (cmd);
-    if (error)
-    {
-      DEBUG_PRINT ("Could query package version: %s", error->message);
-      g_error_free (error);
-    }
-    return NULL;
-  }
+	{
+		g_free (err);
+		g_free (cmd);
+		return out;
+	}
+	else
+	{
+		g_free (out);
+		g_free (err);
+		g_free (cmd);
+		if (error)
+		{
+			DEBUG_PRINT ("Could query package version: %s", error->message);
+			g_error_free (error);
+		}
+		return NULL;
+	}
 }



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