diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-02-05 22:05:53 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-02-05 22:05:53 +0000 |
commit | 3ec88e80365c889f824d9a171fbf197b46a7c03f (patch) | |
tree | f0746a9234070ab3b86fd953827300eb21a0f7bb /block-cloop.c | |
parent | 8a1d02aba9f986ca03d854184cd432ee98bcd179 (diff) |
block: remove error handling from qemu_malloc() callers (Avi Kivity)
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6527 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block-cloop.c')
-rw-r--r-- | block-cloop.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/block-cloop.c b/block-cloop.c index ad0e65d970..6985084bae 100644 --- a/block-cloop.c +++ b/block-cloop.c @@ -75,8 +75,7 @@ cloop_close: /* read offsets */ offsets_size=s->n_blocks*sizeof(uint64_t); - if(!(s->offsets=(uint64_t*)malloc(offsets_size))) - goto cloop_close; + s->offsets=(uint64_t*)qemu_malloc(offsets_size); if(read(s->fd,s->offsets,offsets_size)<offsets_size) goto cloop_close; for(i=0;i<s->n_blocks;i++) { @@ -89,10 +88,8 @@ cloop_close: } /* initialize zlib engine */ - if(!(s->compressed_block = malloc(max_compressed_block_size+1))) - goto cloop_close; - if(!(s->uncompressed_block = malloc(s->block_size))) - goto cloop_close; + s->compressed_block = qemu_malloc(max_compressed_block_size+1); + s->uncompressed_block = qemu_malloc(s->block_size); if(inflateInit(&s->zstream) != Z_OK) goto cloop_close; s->current_block=s->n_blocks; |