summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d7ddea7)
raw | patch | inline | side by side (parent: d7ddea7)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 14:51:57 +0000 (16:51 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 14:51:57 +0000 (16:51 +0200) |
src/libcollectdclient/client.c | patch | blob | history | |
src/libcollectdclient/network.c | patch | blob | history | |
src/libcollectdclient/network_buffer.c | patch | blob | history |
index aeb8f22ae7952334094e1cee4ce60f9394611cb3..8b5ac0bd490b711ae975f467665079f84837d211 100644 (file)
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)
index 7a866ee78c377408ff7187766eaf1061a9c2bdf5..4564fbbe9158c03437f8d81711c4c0ca5e8ce1dd 100644 (file)
{
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;
index 343c285ad9ec35e95fcdcce23420d84b05a959de..130da2355a6c0c23713380101edb1fd9d35fc3e4 100644 (file)
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;