X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fbootchart%2Fbootchart.c;h=37d8fbe6e9add848a7eccb2cc8f3032f1a65ddd6;hp=7bcfd982490f72bd14e9e1782d27860b8889e4ac;hb=a2e9b3380804c9eff565836b0e32b88389d4391c;hpb=53f5329f7aa321d72847cd7f8f28da9a7db80331 diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c index 7bcfd9824..37d8fbe6e 100644 --- a/src/bootchart/bootchart.c +++ b/src/bootchart/bootchart.c @@ -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));