qemu-devel
[Top][All Lists]
Advanced

[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 :(.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]