Peter Maydell 6764579f89 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>
2014-07-01 10:15:34 +02:00
..
2014-06-23 11:01:25 -04:00
2014-06-16 17:23:21 +08:00
2014-06-24 20:01:24 +04:00
2014-02-25 10:50:11 +00:00
2014-06-26 13:51:01 +02:00
2014-04-01 15:22:35 +02:00
2014-07-01 10:15:12 +02:00
2014-06-16 17:23:21 +08:00
2014-06-16 17:23:21 +08:00
2014-06-16 17:23:21 +08:00
2014-06-16 17:23:21 +08:00
2014-06-23 11:01:25 -04:00
2014-07-01 10:15:12 +02:00
2014-03-25 14:09:50 +01:00
2014-06-16 17:23:21 +08:00
2014-07-01 10:15:12 +02:00
2014-07-01 10:15:12 +02:00
2014-06-16 17:23:21 +08:00