summaryrefslogtreecommitdiffstats
path: root/pcp
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2021-02-22 16:52:32 +1100
committerNathan Scott <nathans@redhat.com>2021-06-09 17:09:29 +1000
commit0e7ae9a59296823770fa1f470192e8a7b569d302 (patch)
tree11caa5ecc364eb4a5aef996a0a6236f33dd77a9d /pcp
parent407d32e1213b655e64b21f9864f8117a4d80871c (diff)
Ensure PCP platform ZramMeter always uses initialized data
Diffstat (limited to 'pcp')
-rw-r--r--pcp/Platform.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pcp/Platform.c b/pcp/Platform.c
index 5882338b..ebb70549 100644
--- a/pcp/Platform.c
+++ b/pcp/Platform.c
@@ -602,11 +602,13 @@ void Platform_setSwapValues(Meter* this) {
}
void Platform_setZramValues(Meter* this) {
- (void)this;
-
int i, count = Metric_instanceCount(PCP_ZRAM_CAPACITY);
- if(!count)
+ if (!count) {
+ this->total = 0;
+ this->values[0] = 0;
+ this->values[1] = 0;
return;
+ }
pmAtomValue *values = xCalloc(count, sizeof(pmAtomValue));
ZramStats stats = {0};

© 2014-2024 Faster IT GmbH | imprint | privacy policy