mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
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:
parent
236e237681
commit
5bdf61fdd7
1 changed files with 2 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue