[gnome-settings-daemon] updates: Fix a small memory leak when inhibiting the session
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] updates: Fix a small memory leak when inhibiting the session
- Date: Mon, 2 Jul 2012 09:41:58 +0000 (UTC)
commit e2e18f39c140ac1633d9cac974561367a62a7d39
Author: Richard Hughes <richard hughsie com>
Date: Mon Jul 2 10:38:58 2012 +0100
updates: Fix a small memory leak when inhibiting the session
Resolves: https://bugzilla.gnome.org/show_bug.cgi?id=679097
plugins/updates/gsd-updates-manager.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/plugins/updates/gsd-updates-manager.c b/plugins/updates/gsd-updates-manager.c
index a3d833f..fbfec41 100644
--- a/plugins/updates/gsd-updates-manager.c
+++ b/plugins/updates/gsd-updates-manager.c
@@ -189,6 +189,7 @@ show_offline_updates_error (GsdUpdatesManager *manager)
dialog);
gtk_widget_show (dialog);
clear_offline_updates_message ();
+ g_string_free (msg, TRUE);
}
static void
@@ -956,7 +957,7 @@ session_inhibit (GsdUpdatesManager *manager)
{
const gchar *reason;
GError *error = NULL;
- GVariant *retval;
+ GVariant *retval = NULL;
/* state invalid somehow */
if (manager->priv->inhibit_cookie != 0) {
@@ -988,14 +989,15 @@ session_inhibit (GsdUpdatesManager *manager)
g_variant_get (retval, "(u)",
&manager->priv->inhibit_cookie);
out:
- return;
+ if (retval != NULL)
+ g_variant_unref (retval);
}
static void
session_uninhibit (GsdUpdatesManager *manager)
{
GError *error = NULL;
- GVariant *retval;
+ GVariant *retval = NULL;
/* state invalid somehow */
if (manager->priv->inhibit_cookie == 0) {
@@ -1018,7 +1020,8 @@ session_uninhibit (GsdUpdatesManager *manager)
}
out:
manager->priv->inhibit_cookie = 0;
- return;
+ if (retval != NULL)
+ g_variant_unref (retval);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]