block: fix vvfat error path for enable_write_target
commit78f27bd02ceba4a2f6ac5c725f4d4410eec205ef
authorFam Zheng <famz@redhat.com>
Wed, 17 Jul 2013 09:57:37 +0000 (17 17:57 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 19 Jul 2013 04:29:21 +0000 (19 12:29 +0800)
treee886fb2aaceb5ca84e4fc37c5dae43e273a92e8a
parentdcc772e2f2b7c2a68644133fea2b874f6751a57b
block: fix vvfat error path for enable_write_target

s->qcow and s->qcow_filename are allocated but not freed on error. Fix the
possible leaks, remove unnecessary check for bdrv_new(), propagate ret code of
bdrv_create() and also the one of enable_write_target().

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/vvfat.c