diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-06-30 19:03:37 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-07-01 10:15:34 +0200 |
commit | 6764579f894950afe87d8ec3b323adde8925d4fd (patch) | |
tree | bfa56bfa82c72c4fd5252f4950f578117835e3e6 /target-i386/int_helper.c | |
parent | 4caf0fcd45db46920a6264b1621ae6adc772ef19 (diff) |
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 'target-i386/int_helper.c')
0 files changed, 0 insertions, 0 deletions