qcow2: don't leak buffer for unexpected qcow_version in header

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Jim Meyering 2012-05-21 13:06:54 +02:00 committed by Kevin Wolf
parent aeb29b6459
commit b6c147622d
1 changed files with 2 additions and 1 deletions

View File

@ -919,7 +919,8 @@ int qcow2_update_header(BlockDriverState *bs)
ret = sizeof(*header);
break;
default:
return -EINVAL;
ret = -EINVAL;
goto fail;
}
buf += ret;