int status = 0;
int i;
- dd = malloc (sizeof (*dd));
+ dd = calloc (1, sizeof (*dd));
if (dd == NULL)
return (-1);
- memset (dd, '\0', sizeof (data_definition_t));
status = cf_util_get_string(ci, &dd->name);
if (status != 0)
char cb_name[DATA_MAX_NAME_LEN];
user_data_t cb_data;
- hd = malloc (sizeof (*hd));
+ hd = calloc (1, sizeof (*hd));
if (hd == NULL)
return (-1);
- memset (hd, '\0', sizeof (host_definition_t));
hd->version = 2;
C_COMPLAIN_INIT (&hd->complaint);
csnmp_oid_init (&vb_name, vb->name, vb->name_length);
- il = malloc (sizeof (*il));
+ il = calloc (1, sizeof (*il));
if (il == NULL)
{
- ERROR ("snmp plugin: malloc failed.");
+ ERROR ("snmp plugin: calloc failed.");
return (-1);
}
- memset (il, 0, sizeof (*il));
il->next = NULL;
status = csnmp_oid_suffix (&il->suffix, &vb_name, &dd->instance.oid);
continue;
}
- vt = malloc (sizeof (*vt));
+ vt = calloc (1, sizeof (*vt));
if (vt == NULL)
{
- ERROR ("snmp plugin: malloc failed.");
+ ERROR ("snmp plugin: calloc failed.");
status = -1;
break;
}
- memset (vt, 0, sizeof (*vt));
vt->value = csnmp_value_list_to_value (vb, ds->ds[i].type,
data->scale, data->shift, host->name, data->name);