diff options
author | Jens Axboe <axboe@fb.com> | 2016-05-03 08:34:50 -0600 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-05-03 08:34:50 -0600 |
commit | d1422556dbff03e982aeb2faf5893b4363621bee (patch) | |
tree | c0b002d6328d751940f0183126416296011705c9 | |
parent | cbd4bc0a3f6386cd000cb842b9f1f6325e301623 (diff) | |
download | blktrace-d1422556dbff03e982aeb2faf5893b4363621bee.tar.gz |
btt/unplug_hist: fix bad memset
Just replace the malloc/memset with a calloc().
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r-- | btt/unplug_hist.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/btt/unplug_hist.c b/btt/unplug_hist.c index 89995de..be16b69 100644 --- a/btt/unplug_hist.c +++ b/btt/unplug_hist.c @@ -34,11 +34,11 @@ void *unplug_hist_alloc(struct d_info *dip) { struct hist_bkt *hbp; - if (unplug_hist_name == NULL) return NULL; + if (unplug_hist_name == NULL) + return NULL; - hbp = malloc(sizeof(*hbp)); + hbp = calloc(1, sizeof(*hbp)); hbp->dip = dip; - memset(hbp->hist, 0, NBKTS * sizeof(int)); return hbp; } |