From: Luiz Capitulino Date: Wed, 17 Oct 2012 19:45:25 +0000 (-0300) Subject: block: bdrv_create(): don't leak cco.filename on error X-Git-Tag: v1.3.0-rc0~143^2~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=80168bff43760bde98388480dc7c93f94693421c;p=thirdparty%2Fqemu.git block: bdrv_create(): don't leak cco.filename on error Signed-off-by: Luiz Capitulino Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- diff --git a/block.c b/block.c index 5e7fc9eb27e..7e26b6fa4f2 100644 --- a/block.c +++ b/block.c @@ -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; }