[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/20] iscsi: Handle failure for potentially lar
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 07/20] iscsi: Handle failure for potentially large allocations |
Date: |
Thu, 22 May 2014 17:58:56 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, May 21, 2014 at 06:28:05PM +0200, Kevin Wolf wrote:
> @@ -550,7 +553,11 @@ static BlockDriverAIOCB
> *iscsi_aio_ioctl(BlockDriverState *bs,
> #else
> struct iovec *iov = (struct iovec *)acb->ioh->dxferp;
>
> - acb->buf = g_malloc(acb->ioh->dxfer_len);
> + acb->buf = g_try_malloc(acb->ioh->dxfer_len);
> + if (acb->buf == NULL) {
> + qemu_aio_release(acb);
> + return NULL;
> + }
Leaks acb->task which happens to be malloc(3) allocated :(.
- [Qemu-devel] [PATCH 04/20] cloop: Handle failure for potentially large allocations, (continued)
- [Qemu-devel] [PATCH 04/20] cloop: Handle failure for potentially large allocations, Kevin Wolf, 2014/05/21
- [Qemu-devel] [PATCH 02/20] block: Handle failure for potentially large allocations, Kevin Wolf, 2014/05/21
- [Qemu-devel] [PATCH 05/20] curl: Handle failure for potentially large allocations, Kevin Wolf, 2014/05/21
- [Qemu-devel] [PATCH 06/20] dmg: Handle failure for potentially large allocations, Kevin Wolf, 2014/05/21
- [Qemu-devel] [PATCH 07/20] iscsi: Handle failure for potentially large allocations, Kevin Wolf, 2014/05/21
- [Qemu-devel] [PATCH 09/20] parallels: Handle failure for potentially large allocations, Kevin Wolf, 2014/05/21
- [Qemu-devel] [PATCH 08/20] nfs: Handle failure for potentially large allocations, Kevin Wolf, 2014/05/21
- [Qemu-devel] [PATCH 10/20] qcow1: Handle failure for potentially large allocations, Kevin Wolf, 2014/05/21
- [Qemu-devel] [PATCH 11/20] qcow2: Handle failure for potentially large allocations, Kevin Wolf, 2014/05/21
- [Qemu-devel] [PATCH 12/20] qed: Handle failure for potentially large allocations, Kevin Wolf, 2014/05/21