Kaydet (Commit) 69321746 authored tarafından Michael Meeks's avatar Michael Meeks Kaydeden (comit) Miklos Vajna

sdremote: kill memory corruption / mis-matched alloc/free's.

(cherry picked from commit e99b540d)

Change-Id: I253f28d7c83371282adde86c8eaadd6f25beff5a
Signed-off-by: 's avatarMiklos Vajna <vmiklos@suse.cz>
üst 9822eed6
...@@ -119,7 +119,7 @@ bool BluetoothServer::isDiscoverable() ...@@ -119,7 +119,7 @@ bool BluetoothServer::isDiscoverable()
return false; return false;
} }
GHashTable* aProperties; GHashTable* aProperties = NULL;
aResult = dbus_g_proxy_call( aAdapter, "GetProperties", &aError, aResult = dbus_g_proxy_call( aAdapter, "GetProperties", &aError,
G_TYPE_INVALID, G_TYPE_INVALID,
DBUS_TYPE_G_STRING_ANY_HASHTABLE, &aProperties, DBUS_TYPE_G_STRING_ANY_HASHTABLE, &aProperties,
...@@ -136,7 +136,7 @@ bool BluetoothServer::isDiscoverable() ...@@ -136,7 +136,7 @@ bool BluetoothServer::isDiscoverable()
gboolean aIsDiscoverable = g_value_get_boolean( (GValue*) g_hash_table_lookup( gboolean aIsDiscoverable = g_value_get_boolean( (GValue*) g_hash_table_lookup(
aProperties, "Discoverable" ) ); aProperties, "Discoverable" ) );
g_free( aProperties ); g_hash_table_unref( aProperties );
return aIsDiscoverable; return aIsDiscoverable;
#else // defined(LINUX) && defined(ENABLE_DBUS) #else // defined(LINUX) && defined(ENABLE_DBUS)
return false; return false;
...@@ -188,7 +188,7 @@ void BluetoothServer::setDiscoverable( bool aDiscoverable ) ...@@ -188,7 +188,7 @@ void BluetoothServer::setDiscoverable( bool aDiscoverable )
gboolean aPowered = g_value_get_boolean( (GValue*) g_hash_table_lookup( gboolean aPowered = g_value_get_boolean( (GValue*) g_hash_table_lookup(
aProperties, "Powered" ) ); aProperties, "Powered" ) );
g_free( aProperties ); g_hash_table_unref( aProperties );
if ( !aPowered ) if ( !aPowered )
{ {
SAL_INFO( "sdremote.bluetooth", "Bluetooth adapter not powered, returning" ); SAL_INFO( "sdremote.bluetooth", "Bluetooth adapter not powered, returning" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment