chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bootchart: Convert malloc/memset to calloc
[elogind.git]
/
src
/
bootchart
/
bootchart.c
diff --git
a/src/bootchart/bootchart.c
b/src/bootchart/bootchart.c
index 7bcfd982490f72bd14e9e1782d27860b8889e4ac..37d8fbe6e9add848a7eccb2cc8f3032f1a65ddd6 100644
(file)
--- 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 */
}
/* start with empty ps LL */
- ps_first =
malloc(
sizeof(struct ps_struct));
+ ps_first =
calloc(1,
sizeof(struct ps_struct));
if (!ps_first) {
if (!ps_first) {
- perror("
m
alloc(ps_struct)");
+ perror("
c
alloc(ps_struct)");
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
- memset(ps_first, 0, sizeof(struct ps_struct));
/* handle TERM/INT nicely */
memset(&sig, 0, sizeof(struct sigaction));
/* handle TERM/INT nicely */
memset(&sig, 0, sizeof(struct sigaction));