0a122b
From 8dddbd7dc9948e743695166bab2b7ca94012badf Mon Sep 17 00:00:00 2001
0a122b
From: Kevin Wolf <kwolf@redhat.com>
0a122b
Date: Fri, 7 Feb 2014 15:29:00 +0100
0a122b
Subject: [PATCH 25/37] lock: Fix memory leaks in bdrv_co_do_pwritev()
0a122b
0a122b
Message-id: <1392117622-28812-26-git-send-email-kwolf@redhat.com>
0a122b
Patchwork-id: 57190
0a122b
O-Subject: [RHEL-7.0 qemu-kvm PATCH v2 25/37] block: Fix memory leaks in bdrv_co_do_pwritev()
0a122b
Bugzilla: 748906
0a122b
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
0a122b
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
RH-Acked-by: Max Reitz <mreitz@redhat.com>
0a122b
0a122b
The error path for a failure in one of the two bdrv_aligned_preadv()
0a122b
calls leaked head_buf or tail_buf, respectively. This fixes the memory
0a122b
leak.
0a122b
0a122b
Reported-by: Laszlo Ersek <lersek@redhat.com>
0a122b
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
0a122b
Reviewed-by: Eric Blake <eblake@redhat.com>
0a122b
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
0a122b
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
0a122b
---
0a122b
 block.c | 4 ++--
0a122b
 1 file changed, 2 insertions(+), 2 deletions(-)
0a122b
---
0a122b
 block.c |    4 ++--
0a122b
 1 files changed, 2 insertions(+), 2 deletions(-)
0a122b
0a122b
diff --git a/block.c b/block.c
0a122b
index 3ec3949..9eeb072 100644
0a122b
--- a/block.c
0a122b
+++ b/block.c
0a122b
@@ -3180,9 +3180,9 @@ fail:
0a122b
 
0a122b
     if (use_local_qiov) {
0a122b
         qemu_iovec_destroy(&local_qiov);
0a122b
-        qemu_vfree(head_buf);
0a122b
-        qemu_vfree(tail_buf);
0a122b
     }
0a122b
+    qemu_vfree(head_buf);
0a122b
+    qemu_vfree(tail_buf);
0a122b
 
0a122b
     return ret;
0a122b
 }
0a122b
-- 
0a122b
1.7.1
0a122b