diff options
author | David Teigland <teigland@redhat.com> | 2019-11-14 12:31:31 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2019-11-27 11:13:43 -0600 |
commit | 13c629fb7840e73a38afb9396cae93ea10955a21 (patch) | |
tree | 881dc23839d4e33413b5c867f5ce2f86d1185763 | |
parent | 39bd9b111bc6d2bcb56dfc5859e691b9c90db4c0 (diff) | |
download | lvm2-13c629fb7840e73a38afb9396cae93ea10955a21.tar.gz |
Revert "cov: use zalloc"
This reverts commit 9af1d63b4d96facb0aa055a44c2f61eac01e13f2.
fixes folded into subsequent pvck commit
-rw-r--r-- | tools/pvck.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/pvck.c b/tools/pvck.c index ab3f7dbac..231faf998 100644 --- a/tools/pvck.c +++ b/tools/pvck.c @@ -652,8 +652,9 @@ static int _dump_meta_area(struct device *dev, const char *tofile, if (!tofile) return_0; - if (!(meta_buf = zalloc(mda_size))) + if (!(meta_buf = malloc(mda_size))) return_0; + memset(meta_buf, 0, mda_size); if (!dev_read_bytes(dev, mda_offset, mda_size, meta_buf)) { log_print("CHECK: failed to read metadata area at offset %llu size %llu", @@ -704,11 +705,12 @@ static int _dump_current_text(struct device *dev, int ri = rlocn_index; /* 0 or 1 */ int bad = 0; - if (!(meta_buf = zalloc(meta_size))) { + if (!(meta_buf = malloc(meta_size))) { log_print("CHECK: mda_header_%d.raw_locn[%d] no mem for metadata text size %llu", mn, ri, (unsigned long long)meta_size); return 0; } + memset(meta_buf, 0, meta_size); /* * Read the metadata text specified by the raw_locn so we can @@ -1482,8 +1484,9 @@ static int _dump_search(struct cmd_context *cmd, log_print("Searching for metadata in mda%d at offset %llu size %llu", mda_num, (unsigned long long)mda_offset, (unsigned long long)mda_size); - if (!(buf = zalloc(mda_size))) + if (!(buf = malloc(mda_size))) return ECMD_FAILED; + memset(buf, 0, mda_size); if (!dev_read_bytes(dev, mda_offset, mda_size, buf)) { log_print("CHECK: failed to read metadata area at offset %llu size %llu", |