diff --git a/statslog.c b/statslog.c index c0fd6df..4f76261 100644 --- a/statslog.c +++ b/statslog.c @@ -351,7 +351,7 @@ bool init_poll_kernel(struct kernel_poll_info *poll_info) { static void proc_insert(struct proc* procp) { if (!pidhash) { - pidhash = calloc(PIDHASH_SZ, sizeof(struct proc)); + pidhash = calloc(PIDHASH_SZ, sizeof(*pidhash)); } int hval = pid_hashfn(procp->pid); @@ -426,7 +426,7 @@ void stats_purge_tasknames() { procp = next; } } - memset(pidhash, 0, PIDHASH_SZ * sizeof(struct proc)); + memset(pidhash, 0, PIDHASH_SZ * sizeof(*pidhash)); } #endif /* LMKD_LOG_STATS */