qcow2: Fix grow_refcount_table error handling
commitc5baaa489f5557fa01431ba0c5de28b43fc9631e
authorKevin Wolf <kwolf@redhat.com>
Thu, 15 Oct 2009 15:31:01 +0000 (15 17:31 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 27 Oct 2009 17:28:35 +0000 (27 12:28 -0500)
tree156066310c1c2e9f192c11c79fbbaf7cc92eb393
parentdcc7e25fd18e453168c8f2e59b50a335d0a9346a
qcow2: Fix grow_refcount_table error handling

In case of failure, we haven't increased the refcount for the newly allocated
cluster yet. Therefore we must not free the cluster or its refcount will become
negative (and endless recursion is possible).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block/qcow2-refcount.c