From 405a27640b33c31ccef4001b3f3936b8c9d2218f Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 5 Jun 2014 16:19:26 +0200 Subject: [PATCH] rbd: Fix leaks in rbd_start_aio() error path Signed-off-by: Kevin Wolf Reviewed-by: Benoit Canet Reviewed-by: Josh Durgin Signed-off-by: Stefan Hajnoczi --- block/rbd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/block/rbd.c b/block/rbd.c index a78760b7fe..93639f783c 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -685,13 +685,16 @@ static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs, } if (r < 0) { - goto failed; + goto failed_completion; } return &acb->common; +failed_completion: + rbd_aio_release(c); failed: g_free(rcb); + qemu_vfree(acb->bounce); qemu_aio_release(acb); return NULL; }