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>
This commit is contained in:
Luiz Capitulino 2012-10-17 16:45:25 -03:00 committed by Kevin Wolf
parent e53575606a
commit 80168bff43
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}