diff options
| author | Peter Maydell | 2014-06-30 20:03:37 +0200 |
|---|---|---|
| committer | Stefan Hajnoczi | 2014-07-01 10:15:34 +0200 |
| commit | 6764579f894950afe87d8ec3b323adde8925d4fd (patch) | |
| tree | bfa56bfa82c72c4fd5252f4950f578117835e3e6 /qapi | |
| parent | block: simplify bdrv_find_base() and bdrv_find_overlay() (diff) | |
| download | qemu-6764579f894950afe87d8ec3b323adde8925d4fd.tar.gz qemu-6764579f894950afe87d8ec3b323adde8925d4fd.tar.xz qemu-6764579f894950afe87d8ec3b323adde8925d4fd.zip | |
block/cow: Avoid use of uninitialized cow_bs in error path
Commit 25814e8987 introduced an error-exit code path which does
a "goto exit" before the cow_bs variable is initialized, meaning
we would call bdrv_unref() on an uninitialized variable and
likely segfault. Fix this by moving the NULL-initialization
to the top of the function and making the exit code path handle
the case where it is NULL.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'qapi')
0 files changed, 0 insertions, 0 deletions
