[gnome-power-manager] Fix crash due to unreffing floating GVariants (rh #662279)
- From: Dan Williams <dcbw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-power-manager] Fix crash due to unreffing floating GVariants (rh #662279)
- Date: Wed, 15 Dec 2010 20:46:41 +0000 (UTC)
commit 1efe47d4961e893ac2b6fbab4af25ead3f0d89d6
Author: Dan Williams <dcbw redhat com>
Date: Wed Dec 15 14:36:45 2010 -0600
Fix crash due to unreffing floating GVariants (rh #662279)
Anything created wtih g_variant_new_* is floating, as is the return
value from g_variant_builder_end. Since they are floating, unreffing
them is an error, and that causes a double-free later on. Leave them
alone and they'll clean up after themselves.
Showed up nicely in valgrind using G_SLICE=always-malloc.
src/gpm-manager.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
---
diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index 4c9fc3a..9a241d6 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -2099,10 +2099,6 @@ gpm_manager_dbus_method_call (GDBusConnection *connection,
out:
if (array != NULL)
g_ptr_array_unref (array);
- if (tuple != NULL)
- g_variant_unref (tuple);
- if (value != NULL)
- g_variant_unref (value);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]