diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2012-10-17 16:45:25 -0300 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-10-24 10:26:19 +0200 |
commit | 80168bff43760bde98388480dc7c93f94693421c (patch) | |
tree | b203e8194947d9d2588ab1ddc78ae98b9d1c2af4 /block.c | |
parent | e53575606aa5567bde3246cdc3af1fdc757f77c8 (diff) | |
download | qemu-80168bff43760bde98388480dc7c93f94693421c.zip qemu-80168bff43760bde98388480dc7c93f94693421c.tar.gz qemu-80168bff43760bde98388480dc7c93f94693421c.tar.bz2 |
block: bdrv_create(): don't leak cco.filename on error
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -379,7 +379,8 @@ int bdrv_create(BlockDriver *drv, const char* filename, }; if (!drv->bdrv_create) { - return -ENOTSUP; + ret = -ENOTSUP; + goto out; } if (qemu_in_coroutine()) { @@ -394,8 +395,9 @@ int bdrv_create(BlockDriver *drv, const char* filename, } ret = cco.ret; - g_free(cco.filename); +out: + g_free(cco.filename); return ret; } |