aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2010-12-06 15:25:35 +0100
committerKevin Wolf <kwolf@redhat.com>2010-12-14 15:44:21 +0100
commit5bdf61fdd76b5ca7101353abbdbcd1ed692fa9e2 (patch)
tree89c477ed03a2c3a416f6a7e7b2e0fc735cd58964 /qemu-img.c
parent236e2376818251382f8811d46503581fde798ea3 (diff)
Use qemu_mallocz() instead of calloc() in img_convert()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/qemu-img.c b/qemu-img.c
index fa77ac0dbe..eca99c4a5d 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -699,11 +699,7 @@ static int img_convert(int argc, char **argv)
return 1;
}
- bs = calloc(bs_n, sizeof(BlockDriverState *));
- if (!bs) {
- error("Out of memory");
- return 1;
- }
+ bs = qemu_mallocz(bs_n * sizeof(BlockDriverState *));
total_sectors = 0;
for (bs_i = 0; bs_i < bs_n; bs_i++) {
@@ -983,7 +979,7 @@ out:
bdrv_delete(bs[bs_i]);
}
}
- free(bs);
+ qemu_free(bs);
if (ret) {
return 1;
}