_I("connectedTime: %u", bluetooth_record->connectedTime);
/* Getting app data */
- GSList *app_list = NULL, *l = NULL;
- app_list = bluetooth_record->atm_list;
+ GSList *l = NULL;
bt_battery_app_info_s *app_info = NULL;
for (l = battery_data.atm_list; l != NULL; l = g_slist_next(l)) {
_E("app_info is NULL");
free_app_list(bluetooth_record->atm_list);
free(bluetooth_record);
+ free(app_record);
return BM_PLUGIN_ERROR_NO_DATA;
}
app_record->tx = app_info->tx_bytes;
/* Fill the app_record with the values of the app_time_map_st2 */
- app_list = g_slist_append(app_list, app_record);
+ bluetooth_record->atm_list =
+ g_slist_append(bluetooth_record->atm_list, app_record);
}
/*Append BT data to head node as per design doc*/