treewide: cleanup malloc calls
[collectd.git] / src / cpu.c
index 7f8c985..9c432d1 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -814,8 +814,7 @@ static int cpu_read (void)
 
        if (pnumcpu != numcpu || perfcpu == NULL)
        {
-               if (perfcpu != NULL)
-                       free(perfcpu);
+               free(perfcpu);
                perfcpu = malloc(numcpu * sizeof(perfstat_cpu_t));
        }
        pnumcpu = numcpu;