projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use calloc() instead of malloc + memset
[fio.git]
/
iolog.c
diff --git
a/iolog.c
b/iolog.c
index ef8b84145db0e14f808bdb53539184011b44975b..cfcab2712d1026e20a71c27dcc2428a1a76923f2 100644
(file)
--- a/
iolog.c
+++ b/
iolog.c
@@
-539,9
+539,9
@@
int init_iolog(struct thread_data *td)
void setup_log(struct io_log **log, struct log_params *p,
const char *filename)
{
void setup_log(struct io_log **log, struct log_params *p,
const char *filename)
{
- struct io_log *l
= malloc(sizeof(*l))
;
+ struct io_log *l;
-
memset(l, 0
, sizeof(*l));
+
l = calloc(1
, sizeof(*l));
l->nr_samples = 0;
l->max_samples = 1024;
l->log_type = p->log_type;
l->nr_samples = 0;
l->max_samples = 1024;
l->log_type = p->log_type;