From 407d32e1213b655e64b21f9864f8117a4d80871c Mon Sep 17 00:00:00 2001 From: Sohaib Date: Mon, 22 Feb 2021 16:50:39 +1100 Subject: [PATCH] Fix PCP ZramMeter in presense of missing zram metrics --- pcp/Platform.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pcp/Platform.c b/pcp/Platform.c index 37074cc2..5882338b 100644 --- a/pcp/Platform.c +++ b/pcp/Platform.c @@ -605,6 +605,9 @@ void Platform_setZramValues(Meter* this) { (void)this; int i, count = Metric_instanceCount(PCP_ZRAM_CAPACITY); + if(!count) + return; + pmAtomValue *values = xCalloc(count, sizeof(pmAtomValue)); ZramStats stats = {0};