Re: [Qemu-devel] [PATCH 2/4] qcow2: Use g_try_new0() for cache array

2014-08-18 Thread Max Reitz
On 18.08.2014 22:00, Max Reitz wrote: 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 --- block/qcow2-cache.c | 7 +++

[Qemu-devel] [PATCH 2/4] qcow2: Use g_try_new0() for cache array

2014-08-18 Thread Max Reitz
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 --- block/qcow2-cache.c | 7 +-- 1 file changed, 5 insertions(+), 2