Commit 28ec11bc authored by Kevin Wolf's avatar Kevin Wolf

bochs: Fix memory leak in bochs_open() error path

Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
parent f516a5cc
......@@ -150,11 +150,13 @@ static int bochs_open(BlockDriverState *bs, QDict *options, int flags,
s->extent_size = le32_to_cpu(bochs.extent);
if (s->extent_size == 0) {
error_setg(errp, "Extent size may not be zero");
return -EINVAL;
ret = -EINVAL;
goto fail;
} else if (s->extent_size > 0x800000) {
error_setg(errp, "Extent size %" PRIu32 " is too large",
s->extent_size);
return -EINVAL;
ret = -EINVAL;
goto fail;
}
if (s->catalog_size < bs->total_sectors / s->extent_size) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment