From: Kevin Wolf Date: Thu, 5 Jun 2014 14:19:26 +0000 (+0200) Subject: rbd: Fix leaks in rbd_start_aio() error path X-Git-Tag: qemu-xen-4.6.0-rc1~400^2~6 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=405a27640b33c31ccef4001b3f3936b8c9d2218f;p=qemu-xen.git 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 --- 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; }