sim-card
/
qemu
Archived
10
0
Fork 0

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>
This commit is contained in:
Jes Sorensen 2010-12-06 15:25:35 +01:00 committed by Kevin Wolf
parent 236e237681
commit 5bdf61fdd7
1 changed files with 2 additions and 6 deletions

View File

@ -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;
}