if (ret_con == NULL)
return (-1);
- c = malloc (sizeof (*c));
+ c = calloc (1, sizeof (*c));
if (c == NULL)
return (-1);
- memset (c, 0, sizeof (*c));
status = lcc_open_socket (c, address);
if (status != 0)
{
lcc_network_t *net;
- net = malloc (sizeof (*net));
+ net = calloc (1, sizeof (*net));
if (net == NULL)
return (NULL);
- memset (net, 0, sizeof (*net));
net->servers = NULL;
if (service == NULL)
service = NET_DEFAULT_PORT;
- srv = malloc (sizeof (*srv));
+ srv = calloc (1, sizeof (*srv));
if (srv == NULL)
return (NULL);
- memset (srv, 0, sizeof (*srv));
srv->fd = -1;
srv->security_level = NONE;
return (NULL);
}
- nb = malloc (sizeof (*nb));
+ nb = calloc (1, sizeof (*nb));
if (nb == NULL)
return (NULL);
- memset (nb, 0, sizeof (*nb));
nb->size = size;
- nb->buffer = malloc (nb->size);
+ nb->buffer = calloc (1, nb->size);
if (nb->buffer == NULL)
{
free (nb);
return (NULL);
}
- memset (nb->buffer, 0, nb->size);
nb->ptr = nb->buffer;
nb->free = nb->size;