From dbdb6415721969dc59fa6a9438b474974a841594 Mon Sep 17 00:00:00 2001 From: Olaf Rempel Date: Sat, 30 Sep 2006 21:31:53 +0200 Subject: [PATCH] gcc4 cleanups --- network.c | 2 +- p_memory.c | 2 ++ p_stat.c | 2 ++ p_vmstat.c | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/network.c b/network.c index dee0a82..880d33b 100644 --- a/network.c +++ b/network.c @@ -45,7 +45,7 @@ void net_submit(char *hostname, char *plugin, char *filename, int ds_id, char *d int net_receive(int socket) { char *hostname, *plugin, *filename, *ds_id, *data; - int size, num; + int size; size = recv(socket, rx_buf, BUFSIZE, 0); diff --git a/p_memory.c b/p_memory.c index f1701c2..67e61a3 100644 --- a/p_memory.c +++ b/p_memory.c @@ -71,6 +71,8 @@ static void probe(void) char *buffer; struct meminfo_ meminfo; + memset(&meminfo, 0, sizeof(meminfo)); + buffer = malloc(BUFSIZE); if (buffer == NULL) { log_print(LOG_WARN, "plugin memory: out of memory"); diff --git a/p_stat.c b/p_stat.c index 4b2fc4b..7734a7d 100644 --- a/p_stat.c +++ b/p_stat.c @@ -72,6 +72,8 @@ static void probe(void) char *buffer; struct proc_ proc; + memset(&proc, 0, sizeof(proc)); + buffer = malloc(BUFSIZE); if (buffer == NULL) { log_print(LOG_WARN, "plugin stat: out of memory"); diff --git a/p_vmstat.c b/p_vmstat.c index 83232c4..7efe60f 100644 --- a/p_vmstat.c +++ b/p_vmstat.c @@ -54,6 +54,8 @@ static void probe(void) char *buffer; struct vmstat_ vmstat; + memset(&vmstat, 0, sizeof(vmstat)); + buffer = malloc(BUFSIZE); if (buffer == NULL) { log_print(LOG_WARN, "plugin vmstat: out of memory");