chiark / gitweb /
bootchart: Convert malloc/memset to calloc
[elogind.git] / src / bootchart / bootchart.c
index 7bcfd982490f72bd14e9e1782d27860b8889e4ac..37d8fbe6e9add848a7eccb2cc8f3032f1a65ddd6 100644 (file)
@@ -232,12 +232,11 @@ int main(int argc, char *argv[])
         }
 
         /* start with empty ps LL */
-        ps_first = malloc(sizeof(struct ps_struct));
+        ps_first = calloc(1, sizeof(struct ps_struct));
         if (!ps_first) {
-                perror("malloc(ps_struct)");
+                perror("calloc(ps_struct)");
                 exit(EXIT_FAILURE);
         }
-        memset(ps_first, 0, sizeof(struct ps_struct));
 
         /* handle TERM/INT nicely */
         memset(&sig, 0, sizeof(struct sigaction));