Errors in l2_allocate should always go down the error path. If this path is taken, the newly allocated L2 cluster is abandoned and should thus be freed. The L2 table on the other hand should only be put back into the cache if it was taken from it before.
Max Reitz (3): qcow2: Don't put invalid L2 table into cache qcow2: Free allocated L2 cluster on error qcow2: Always use error path in l2_allocate block/qcow2-cluster.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) -- 1.8.3.1