diff options
author | Kevin Wolf <kwolf@redhat.com> | 2013-01-25 17:07:31 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-02-01 14:58:29 +0100 |
commit | 4f8aa2e19f88fe0dfaf8240ae666de7fd18dd1d0 (patch) | |
tree | 7d5d6e89e5ba1ed9457c32e46b796dbe955114be | |
parent | 69d34a360dfe773e17e72c76d15931c9b9d190f6 (diff) |
dmg: Use g_free instead of free
The buffers are allocated with g_(re)alloc, so use g_free to free them.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r-- | block/dmg.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/block/dmg.c b/block/dmg.c index 53be25d787..6d85801a84 100644 --- a/block/dmg.c +++ b/block/dmg.c @@ -355,15 +355,15 @@ static coroutine_fn int dmg_co_read(BlockDriverState *bs, int64_t sector_num, static void dmg_close(BlockDriverState *bs) { BDRVDMGState *s = bs->opaque; - if(s->n_chunks>0) { - free(s->types); - free(s->offsets); - free(s->lengths); - free(s->sectors); - free(s->sectorcounts); - } - free(s->compressed_chunk); - free(s->uncompressed_chunk); + + g_free(s->types); + g_free(s->offsets); + g_free(s->lengths); + g_free(s->sectors); + g_free(s->sectorcounts); + g_free(s->compressed_chunk); + g_free(s->uncompressed_chunk); + inflateEnd(&s->zstream); } |