if (*ret_buffer_len < packet_len)
return (-1);
- pkg_values_types = (uint8_t *) malloc (num_values * sizeof (uint8_t));
+ pkg_values_types = malloc (num_values * sizeof (*pkg_values_types));
if (pkg_values_types == NULL)
{
ERROR ("network plugin: write_part_values: malloc failed.");
return (-1);
}
- pkg_values = (value_t *) malloc (num_values * sizeof (value_t));
+ pkg_values = malloc (num_values * sizeof (*pkg_values));
if (pkg_values == NULL)
{
free (pkg_values_types);
* these entries in the dispatch thread but put them in
* another list, so we don't have to allocate more and
* more of these structures. */
- ent = malloc (sizeof (receive_list_entry_t));
+ ent = malloc (sizeof (*ent));
if (ent == NULL)
{
ERROR ("network plugin: malloc failed.");
break;
}
memset (ent, 0, sizeof (receive_list_entry_t));
- ent->data = malloc (network_config_packet_size);
+ ent->data = malloc (*ent->data);
if (ent->data == NULL)
{
sfree (ent);