qcow2: Use g_try_new0() for cache array
authorMax Reitz <mreitz@redhat.com>
Mon, 18 Aug 2014 20:07:32 +0000 (22:07 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 20 Aug 2014 09:51:28 +0000 (11:51 +0200)
commit02004bd4ba1ace29812e977d3cd0bc20fd6bf677
tree8053459e03f6ad6918978c46ae24900242dac874
parent440ba08aea3d841996efaf6a6b88426b0d59abf4
qcow2: Use g_try_new0() for cache array

With a variable cache size, the number given to qcow2_cache_create() may
be huge. Therefore, use g_try_new0().

While at it, use g_new0() instead of g_malloc0() for allocating the
Qcow2Cache object.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2-cache.c