[gnome-color-manager] Fix several small memory leaks spotted by valgrind



commit a1adc5e3921f52393b220d8d02f36d2ea6bfaa47
Author: Richard Hughes <richard hughsie com>
Date:   Wed Nov 18 13:43:25 2009 +0000

    Fix several small memory leaks spotted by valgrind

 src/gcm-clut.c   |    2 ++
 src/gcm-device.c |    3 ++-
 src/gcm-prefs.c  |    1 +
 3 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-clut.c b/src/gcm-clut.c
index c70e796..1afa491 100644
--- a/src/gcm-clut.c
+++ b/src/gcm-clut.c
@@ -437,6 +437,8 @@ gcm_clut_finalize (GObject *object)
 	GcmClut *clut = GCM_CLUT (object);
 	GcmClutPrivate *priv = clut->priv;
 
+	g_free (clut->priv->copyright);
+	g_free (clut->priv->description);
 	g_free (clut->priv->profile);
 	g_free (clut->priv->id);
 	g_ptr_array_unref (priv->array);
diff --git a/src/gcm-device.c b/src/gcm-device.c
index 2497938..fd68861 100644
--- a/src/gcm-device.c
+++ b/src/gcm-device.c
@@ -282,7 +282,7 @@ gcm_device_save (GcmDevice *device, GError **error)
 {
 	GKeyFile *keyfile = NULL;
 	gboolean ret;
-	gchar *data;
+	gchar *data = NULL;
 	gchar *dirname;
 	GFile *file = NULL;
 	gchar *filename = NULL;
@@ -377,6 +377,7 @@ gcm_device_save (GcmDevice *device, GError **error)
 		goto out;
 	}
 out:
+	g_free (data);
 	g_free (filename);
 	g_free (dirname);
 	if (file != NULL)
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index fd1f789..6cf9302 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -1167,6 +1167,7 @@ out:
 	if (profile != NULL)
 		g_object_unref (profile);
 	g_free (filename);
+	g_free (profile_old);
 	g_free (copyright);
 	g_free (vendor);
 }



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