From: Ruben Kerkhof Date: Fri, 1 Apr 2016 16:23:42 +0000 (+0200) Subject: tcpconns plugin: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e18f44e1765c4be396e6a4d51dc438a6df3b89a;p=thirdparty%2Fcollectd.git tcpconns plugin: malloc + memset -> calloc --- diff --git a/src/tcpconns.c b/src/tcpconns.c index 96221b197..6bc338421 100644 --- 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;