commit | 6a27ed94ab5c2a07f6b98f2bcdce06c56f16e8cd | [log] [tgz] |
---|---|---|
author | Jens Axboe <axboe@fb.com> | Tue Sep 30 10:08:08 2014 -0600 |
committer | Mohamad Ayyash <mkayyash@google.com> | Fri Mar 06 17:57:19 2015 -0800 |
tree | ef30bdd613cdaa18c21e650affe360b03d064a5a | |
parent | bb8d4b86c903c1cfb3c922d7f5e464cd9bc6eb92 [diff] [blame] |
Use calloc() instead of malloc + memset Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/iolog.c b/iolog.c index ef8b841..cfcab27 100644 --- a/iolog.c +++ b/iolog.c
@@ -539,9 +539,9 @@ 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;