projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
236e237
)
Use qemu_mallocz() instead of calloc() in img_convert()
author
Jes Sorensen
<Jes.Sorensen@redhat.com>
Mon, 6 Dec 2010 14:25:35 +0000
(15:25 +0100)
committer
Kevin Wolf
<kwolf@redhat.com>
Tue, 14 Dec 2010 14:44:21 +0000
(15:44 +0100)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img.c
patch
|
blob
|
history
diff --git
a/qemu-img.c
b/qemu-img.c
index fa77ac0dbe87f6fb36d9e6a0b1abd62b752826a7..eca99c4a5d972c50ff297c01d6859239c04b3526 100644
(file)
--- 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;
}