zabbix-agent2/src/libs/zbxserver/expression_eval.c
/******************************************************************************
 *                                                                            *
 * Function: expression_eval_clear                                            *
 *                                                                            *
 * Purpose: free resources allocated by expression evaluation data            *
 *                                                                            *
 * Parameters: eval     - [IN] the evaluation data                            *
 *                                                                            *
 ******************************************************************************/
expression_eval_clear

Purpose: free resources allocated by expression evaluation data

Parameters: eval     - [IN] the evaluation data
expression_eval_clear Purpose : free resources allocated by expression evaluation data Parameters : eval - [ IN ] the evaluation data
void	zbx_expression_eval_clear(zbx_expression_eval_t *eval)
{
	if (0 != eval->one_num)
	{
		DCconfig_clean_items(eval->dcitems_hk, eval->errcodes_hk, eval->one_num);
		zbx_free(eval->dcitems_hk);
		zbx_free(eval->errcodes_hk);
		zbx_free(eval->hostkeys);
	}
	if (0 != eval->dcitems_num)
	{
		DCconfig_clean_items(eval->dcitems, eval->errcodes, eval->dcitems_num);
		zbx_free(eval->dcitems);
		zbx_free(eval->errcodes);
	}
	zbx_vector_ptr_destroy(&eval->dcitem_refs);
	zbx_vector_ptr_clear_ext(&eval->itemtags, (zbx_clean_func_t) expression_item_free);
	zbx_vector_ptr_destroy(&eval->itemtags);
	zbx_vector_ptr_clear_ext(&eval->groups, (zbx_clean_func_t) expression_group_free);
	zbx_vector_ptr_destroy(&eval->groups);
	zbx_vector_ptr_clear_ext(&eval->queries, (zbx_clean_func_t) expression_query_free);
	zbx_vector_ptr_destroy(&eval->queries);
}
void zbx_expression_eval_clear ( zbx_expression_eval_t * eval ) { if ( 0 != eval -> one_num ) { DCconfig_clean_items ( eval -> dcitems_hk , eval -> errcodes_hk , eval -> one_num ) ; zbx_free ( eval -> dcitems_hk ) ; zbx_free ( eval -> errcodes_hk ) ; zbx_free ( eval -> hostkeys ) ; } if ( 0 != eval -> dcitems_num ) { DCconfig_clean_items ( eval -> dcitems , eval -> errcodes , eval -> dcitems_num ) ; zbx_free ( eval -> dcitems ) ; zbx_free ( eval -> errcodes ) ; } zbx_vector_ptr_destroy ( & eval -> dcitem_refs ) ; zbx_vector_ptr_clear_ext ( & eval -> itemtags , ( zbx_clean_func_t ) expression_item_free ) ; zbx_vector_ptr_destroy ( & eval -> itemtags ) ; zbx_vector_ptr_clear_ext ( & eval -> groups , ( zbx_clean_func_t ) expression_group_free ) ; zbx_vector_ptr_destroy ( & eval -> groups ) ; zbx_vector_ptr_clear_ext ( & eval -> queries , ( zbx_clean_func_t ) expression_query_free ) ; zbx_vector_ptr_destroy ( & eval -> queries ) ; }
Function: expression_eval_clear                                            
                                                                            
 Purpose: free resources allocated by expression evaluation data            
                                                                            
 Parameters: eval     - [IN] the evaluation data
Function : expression_eval_clear Purpose : free resources allocated by expression evaluation data Parameters : eval - [ IN ] the evaluation data