X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftcpconns.c;h=6bc3384210ce5a614b4f39b7fb3d05b965165865;hb=f91506bb8f91ca3725fd3081deba4e1829186aaa;hp=96221b1975164d7913f24ade2177130e576bedf2;hpb=1ebf2f31bd2e080e6f42de640f0a3899a61501c0;p=collectd.git diff --git a/src/tcpconns.c b/src/tcpconns.c index 96221b19..6bc33842 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;