X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fswap.c;h=32906fa818217a1519257ad27c49d54f12400bb9;hb=df5d1022f12e9a4620da763bb510095c8ee0777e;hp=d714b5fcdb8d7e558eb02d1c7a787b506bc07230;hpb=b5a33aab585aabef83c79bf3261092ca901edf9c;p=collectd.git diff --git a/src/swap.c b/src/swap.c index d714b5fc..32906fa8 100644 --- a/src/swap.c +++ b/src/swap.c @@ -35,6 +35,7 @@ #endif #include "collectd.h" + #include "common.h" #include "plugin.h" @@ -761,14 +762,13 @@ static int swap_read (void) /* {{{ */ #elif HAVE_PERFSTAT static int swap_read (void) /* {{{ */ { - perfstat_memory_total_t pmemory; + perfstat_memory_total_t pmemory = { 0 }; int status; gauge_t total; gauge_t free; gauge_t reserved; - memset (&pmemory, 0, sizeof (pmemory)); status = perfstat_memory_total (NULL, &pmemory, sizeof(perfstat_memory_total_t), 1); if (status < 0) {