X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftcpconns.c;h=96221b1975164d7913f24ade2177130e576bedf2;hb=1ebf2f31bd2e080e6f42de640f0a3899a61501c0;hp=8f40be6f786b13d901c4ee5847580c0a01db270e;hpb=749b03b3fc459895b7415c7c13753066bf0af55b;p=collectd.git diff --git a/src/tcpconns.c b/src/tcpconns.c index 8f40be6f..96221b19 100644 --- a/src/tcpconns.c +++ b/src/tcpconns.c @@ -283,7 +283,7 @@ static uint32_t count_total[TCP_STATE_MAX + 1]; static uint32_t sequence_number = 0; #endif -enum +static enum { SRC_DUNNO, SRC_NETLINK, @@ -385,7 +385,7 @@ static port_entry_t *conn_get_port_entry (uint16_t port, int create) if ((ret == NULL) && (create != 0)) { - ret = (port_entry_t *) malloc (sizeof (port_entry_t)); + ret = malloc (sizeof (*ret)); if (ret == NULL) return (NULL); memset (ret, '\0', sizeof (port_entry_t)); @@ -832,7 +832,7 @@ static int conn_read (void) return (-1); } - buffer = (char *) malloc (buffer_len); + buffer = malloc (buffer_len); if (buffer == NULL) { ERROR ("tcpconns plugin: malloc failed.");