提交 80168bff 编写于 作者: L Luiz Capitulino 提交者: Kevin Wolf

block: bdrv_create(): don't leak cco.filename on error

Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 e5357560
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册