summaryrefslogtreecommitdiffstats
path: root/usr.bin/mkimg
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mkimg')
-rw-r--r--usr.bin/mkimg/qcow.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/mkimg/qcow.c b/usr.bin/mkimg/qcow.c
index a89761b..4bdc227 100644
--- a/usr.bin/mkimg/qcow.c
+++ b/usr.bin/mkimg/qcow.c
@@ -217,7 +217,7 @@ qcow_write(int fd, u_int version)
ofs = clstrsz * l2clno;
nclstrs = 1 + clstr_l1tblsz + clstr_rctblsz;
- l1tbl = calloc(1, clstrsz * clstr_l1tblsz);
+ l1tbl = calloc(clstr_l1tblsz, clstrsz);
if (l1tbl == NULL) {
error = ENOMEM;
goto out;
@@ -248,7 +248,7 @@ qcow_write(int fd, u_int version)
} while (n < clstr_rcblks);
if (rcclno > 0) {
- rctbl = calloc(1, clstrsz * clstr_rctblsz);
+ rctbl = calloc(clstr_rctblsz, clstrsz);
if (rctbl == NULL) {
error = ENOMEM;
goto out;
@@ -298,7 +298,7 @@ qcow_write(int fd, u_int version)
l1tbl = NULL;
if (rcclno > 0) {
- rcblk = calloc(1, clstrsz * clstr_rcblks);
+ rcblk = calloc(clstr_rcblks, clstrsz);
if (rcblk == NULL) {
error = ENOMEM;
goto out;
OpenPOWER on IntegriCloud