mirror of https://github.com/xemu-project/xemu.git
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
|
@ -699,11 +699,7 @@ static int img_convert(int argc, char **argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bs = calloc(bs_n, sizeof(BlockDriverState *));
|
bs = qemu_mallocz(bs_n * sizeof(BlockDriverState *));
|
||||||
if (!bs) {
|
|
||||||
error("Out of memory");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
total_sectors = 0;
|
total_sectors = 0;
|
||||||
for (bs_i = 0; bs_i < bs_n; bs_i++) {
|
for (bs_i = 0; bs_i < bs_n; bs_i++) {
|
||||||
|
@ -983,7 +979,7 @@ out:
|
||||||
bdrv_delete(bs[bs_i]);
|
bdrv_delete(bs[bs_i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(bs);
|
qemu_free(bs);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue