Avoid calling qemu_mallocz with zero size
commit63c75dcd669d011f438421980b4379827da4bb1c
authormalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>
Fri, 16 Jan 2009 22:32:33 +0000 (16 22:32 +0000)
committermalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>
Fri, 16 Jan 2009 22:32:33 +0000 (16 22:32 +0000)
treeb98f96862b5dd98eb8485ed8cb64c7a681a4fa3f
parent4c62180560cc06866aee509b0c0caed310245c1d
Avoid calling qemu_mallocz with zero size

Currently qemu_mallocz calls malloc and handling of zero by malloc is
implementation defined behaviour:
http://www.opengroup.org/onlinepubs/7990989775/xsh/malloc.html

malloc(0) on AIX returns NULL[1] and qcow2 images without snapshots
are thus unusable

[1] Unless special Linux compatibility define is used when compiling

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6359 c046a42c-6fe2-441c-8c8c-71466251a162
block-qcow2.c