Resolve memory leak in HAL
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / bluez_hal / src / bt-hal-device-dbus-handler.c
index 54f9339..bff47c4 100644 (file)
@@ -636,6 +636,7 @@ static void __bt_device_parse_services(GVariant *result)
        event_cb(HAL_EV_REMOTE_DEVICE_PROPS, (void*) buf, size);
 
        g_variant_unref(result);
+       g_variant_iter_free(property_iter);
 }
 
 int __bt_hal_dbus_enquire_remote_device_services(char *address)
@@ -937,6 +938,8 @@ static gboolean __bt_device_bonded_device_info_cb(gpointer user_data)
                        while (g_variant_iter_loop(char_value_iter, "y", &char_value))
                                g_byte_array_append(manufacturer_data, &char_value, 1);
 
+                       g_variant_iter_free(char_value_iter);
+
                        if (manufacturer_data) {
                                if (manufacturer_data->len > 0) {
                                        size += __bt_insert_hal_properties(
@@ -981,6 +984,7 @@ static gboolean __bt_device_bonded_device_info_cb(gpointer user_data)
 
 done:
        g_variant_unref(result);
+       g_variant_iter_free(property_iter);
        return FALSE;
 }