[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/8] qcow2-cluster: Fix memory leak in copy_sect
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 4/8] qcow2-cluster: Fix memory leak in copy_sectors |
Date: |
Tue, 27 May 2014 13:33:31 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Tue, May 27, 2014 at 09:40:01AM +0800, address@hidden wrote:
> From: Gonglei <address@hidden>
>
> Spotted by Coverity:
>
> (3) Event alloc_fn: Storage is returned from allocation function
> "qemu_blockalign(BlockDriverState *, size_t)". [details]
> (4) Event var_assign: Assigning: "iov.iov_base" = storage returned from
> "qemu_blockalign(bs, iov.iov_len)".
> Also see events: [leaked_storage]
>
> 375 iov.iov_base = qemu_blockalign(bs, iov.iov_len);
> 376
> 377 qemu_iovec_init_external(&qiov, &iov, 1);
> 378
> 379 BLKDBG_EVENT(bs->file, BLKDBG_COW_READ);
> 380
> (5) Event cond_true: Condition "!bs->drv", taking true branch
>
> 381 if (!bs->drv) {
> (6) Event leaked_storage: Variable "iov" going out of scope leaks the
> storage "iov.iov_base" points to.
> Also see events: [alloc_fn][var_assign]
>
> 382 return -ENOMEDIUM;
> 383 }
>
> Signed-off-by: Gonglei <address@hidden>
> ---
> block/qcow2-cluster.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Stefan Hajnoczi <address@hidden>
- Re: [Qemu-devel] [PATCH 6/8] smbus: Fix unreachable code in smb_transaction(), (continued)
- [Qemu-devel] [PATCH 1/8] vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16, 24, 32}, arei.gonglei, 2014/05/26
- Re: [Qemu-devel] [PATCH 1/8] vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16, 24, 32}, Paolo Bonzini, 2014/05/27
- Re: [Qemu-devel] [PATCH 1/8] vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16, 24, 32}, Gonglei (Arei), 2014/05/28
- Re: [Qemu-devel] [PATCH 1/8] vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16, 24, 32}, Paolo Bonzini, 2014/05/28
- Re: [Qemu-devel] [PATCH 1/8] vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16, 24, 32}, Gonglei (Arei), 2014/05/28
- [Qemu-devel] [PATCH 8/8] audio: Fix using freed pointer in wav_fini_out(), arei.gonglei, 2014/05/26
- [Qemu-devel] [PATCH 4/8] qcow2-cluster: Fix memory leak in copy_sectors, arei.gonglei, 2014/05/26
- Re: [Qemu-devel] [PATCH 4/8] qcow2-cluster: Fix memory leak in copy_sectors,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 5/8] qemu-bridge-helper: Fix fd leak in main(), arei.gonglei, 2014/05/26