diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-01-26 12:32:17 +1100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-01-29 11:46:09 +0100 |
commit | ea19e47b3c722a501720b245d6d0a02101014762 (patch) | |
tree | ec00c060c6cd5f2071a38dfe0d3d29da6e8e9672 | |
parent | 6a3091af129ea3e6440e618922cde73496840f17 (diff) |
sdremote: kill memory corruption / mis-matched alloc/free's.
(cherry picked from commit e99b540d8985b87247519c951e6ef65a01b1f5c9)
Change-Id: I253f28d7c83371282adde86c8eaadd6f25beff5a
Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
Signed-off-by: Noel Power <nopower@novell.com>
Signed-off-by: Petr Mladek <pmladek@suse.cz>
-rw-r--r-- | sd/source/ui/remotecontrol/BluetoothServer.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index 41255ba91fc5..86a1fa5d8f52 100644 --- a/sd/source/ui/remotecontrol/BluetoothServer.cxx +++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx @@ -119,7 +119,7 @@ bool BluetoothServer::isDiscoverable() return false; } - GHashTable* aProperties; + GHashTable* aProperties = NULL; aResult = dbus_g_proxy_call( aAdapter, "GetProperties", &aError, G_TYPE_INVALID, DBUS_TYPE_G_STRING_ANY_HASHTABLE, &aProperties, @@ -136,7 +136,7 @@ bool BluetoothServer::isDiscoverable() gboolean aIsDiscoverable = g_value_get_boolean( (GValue*) g_hash_table_lookup( aProperties, "Discoverable" ) ); - g_free( aProperties ); + g_hash_table_unref( aProperties ); return aIsDiscoverable; #else // defined(LINUX) && defined(ENABLE_DBUS) return false; @@ -188,7 +188,7 @@ void BluetoothServer::setDiscoverable( bool aDiscoverable ) gboolean aPowered = g_value_get_boolean( (GValue*) g_hash_table_lookup( aProperties, "Powered" ) ); - g_free( aProperties ); + g_hash_table_unref( aProperties ); if ( !aPowered ) { SAL_INFO( "sdremote.bluetooth", "Bluetooth adapter not powered, returning" ); |