Source
zbx_uint32_t zbx_alerter_serialize_result(unsigned char **data, const char *value, int errcode, const char *error,
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
ZBX_PTR_VECTOR_IMPL(am_mediatype_ptr, zbx_am_mediatype_t *)
ZBX_PTR_VECTOR_IMPL(am_media_ptr, zbx_am_media_t *)
ZBX_PTR_VECTOR_IMPL(am_db_mediatype_ptr, zbx_am_db_mediatype_t *)
ZBX_PTR_VECTOR_IMPL(am_db_alert_ptr, zbx_am_db_alert_t *)
ZBX_PTR_VECTOR_IMPL(am_result_ptr, zbx_am_result_t *)
void zbx_am_db_mediatype_clear(zbx_am_db_mediatype_t *mediatype)
{
zbx_free(mediatype->smtp_server);
zbx_free(mediatype->smtp_helo);
zbx_free(mediatype->smtp_email);
zbx_free(mediatype->exec_path);
zbx_free(mediatype->gsm_modem);
zbx_free(mediatype->username);
zbx_free(mediatype->passwd);
zbx_free(mediatype->script);
zbx_free(mediatype->attempt_interval);
zbx_free(mediatype->timeout);
}
/******************************************************************************
* *
* Purpose: frees the alert object *
* *
* Parameters: alert - [IN] *
* *
******************************************************************************/
void zbx_am_db_alert_free(zbx_am_db_alert_t *alert)
{
zbx_free(alert->sendto);
zbx_free(alert->subject);
zbx_free(alert->message);
zbx_free(alert->params);
zbx_free(alert->expression);
zbx_free(alert->recovery_expression);
zbx_free(alert);
}
void zbx_am_media_clear(zbx_am_media_t *media)
{
zbx_free(media->sendto);