qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/3] block: Fix memory leaks in bdrv_co_do_pwritev()


From: Kevin Wolf
Subject: [Qemu-devel] [PATCH 1/3] block: Fix memory leaks in bdrv_co_do_pwritev()
Date: Fri, 7 Feb 2014 17:12:56 +0100

The error path for a failure in one of the two bdrv_aligned_preadv()
calls leaked head_buf or tail_buf, respectively. This fixes the memory
leak.

Reported-by: Laszlo Ersek <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
 block.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block.c b/block.c
index ac0ccac..c1d1f74 100644
--- a/block.c
+++ b/block.c
@@ -3279,9 +3279,9 @@ fail:
 
     if (use_local_qiov) {
         qemu_iovec_destroy(&local_qiov);
-        qemu_vfree(head_buf);
-        qemu_vfree(tail_buf);
     }
+    qemu_vfree(head_buf);
+    qemu_vfree(tail_buf);
 
     return ret;
 }
-- 
1.8.1.4




reply via email to

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