if ((ret == NULL) && (create != 0))
{
- ret = (port_entry_t *) malloc (sizeof (port_entry_t));
+ ret = calloc (1, sizeof (*ret));
if (ret == NULL)
return (NULL);
- memset (ret, '\0', sizeof (port_entry_t));
ret->port = port;
ret->next = port_list_head;
return (-1);
}
- buffer = (char *) malloc (buffer_len);
+ buffer = malloc (buffer_len);
if (buffer == NULL)
{
ERROR ("tcpconns plugin: malloc failed.");