@cryptotaxi247 / netdata-1 / commits / 1d83d9956

properly initialize softnet_stat

Costa Tsaousis (ktsaou) committed Sep 16, 2016 at 00:23 UTC 1d83d9956ea628e26de206d83d7d643d93b052af
1 file changed +2 -2
src/proc_net_softnet_stat.c
+2 -2
@@ -53,13 +53,13 @@ int do_proc_net_softnet_stat(int update_every, unsigned long long dt) {
53
54 if(unlikely(!data || lines > allocated_lines || words > allocated_columns)) {
55 freez(data);
56 - data = mallocz((lines + 1) * words * sizeof(uint32_t));
56 allocated_lines = lines;
57 allocated_columns = words;
58 + data = mallocz((allocated_lines + 1) * allocated_columns * sizeof(uint32_t));
59 }
60
61 // initialize to zero
62 - bzero(data, allocated_lines * allocated_columns * sizeof(uint32_t));
62 + bzero(data, (allocated_lines + 1) * allocated_columns * sizeof(uint32_t));
63
64 // parse the values
65 for(l = 0; l < lines ;l++) {