projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7b4b1f
)
tcpconns plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:23:42 +0000
(18:23 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:23:42 +0000
(18:23 +0200)
src/tcpconns.c
patch
|
blob
|
history
diff --git
a/src/tcpconns.c
b/src/tcpconns.c
index
96221b1
..
6bc3384
100644
(file)
--- a/
src/tcpconns.c
+++ b/
src/tcpconns.c
@@
-385,10
+385,9
@@
static port_entry_t *conn_get_port_entry (uint16_t port, int create)
if ((ret == NULL) && (create != 0))
{
- ret =
malloc (
sizeof (*ret));
+ 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;