Blame SOURCES/kvm-migration-block-dirty-bitmap-fix-memory-leak-in-dirt.patch

ae23c9
From 2bbbfcc52eb4c82714a8570fe217d80354687186 Mon Sep 17 00:00:00 2001
ae23c9
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
ae23c9
Date: Wed, 1 Aug 2018 13:55:15 +0100
ae23c9
Subject: [PATCH 11/21] migration/block-dirty-bitmap: fix memory leak in
ae23c9
 dirty_bitmap_load_bits
ae23c9
ae23c9
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
ae23c9
Message-id: <20180801135522.11658-12-dgilbert@redhat.com>
ae23c9
Patchwork-id: 81567
ae23c9
O-Subject: [qemu-kvm RHEL8/virt212 PATCH 11/18] migration/block-dirty-bitmap: fix memory leak in dirty_bitmap_load_bits
ae23c9
Bugzilla: 1594384
ae23c9
RH-Acked-by: Peter Xu <peterx@redhat.com>
ae23c9
RH-Acked-by: John Snow <jsnow@redhat.com>
ae23c9
RH-Acked-by: Juan Quintela <quintela@redhat.com>
ae23c9
ae23c9
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
ae23c9
ae23c9
Release buf on error path too.
ae23c9
ae23c9
Bug was introduced in b35ebdf076d697bc "migration: add postcopy
ae23c9
migration of dirty bitmaps" with the whole function.
ae23c9
ae23c9
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
ae23c9
Message-Id: <20180427142002.21930-3-vsementsov@virtuozzo.com>
ae23c9
Reviewed-by: Eric Blake <eblake@redhat.com>
ae23c9
CC: qemu-stable@nongnu.org
ae23c9
Signed-off-by: Eric Blake <eblake@redhat.com>
ae23c9
(cherry picked from commit 16a2227893dc1d5cad78ed376ad1d7e300978fbe)
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 migration/block-dirty-bitmap.c | 1 +
ae23c9
 1 file changed, 1 insertion(+)
ae23c9
ae23c9
diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
ae23c9
index abba0b6..b3b31ba 100644
ae23c9
--- a/migration/block-dirty-bitmap.c
ae23c9
+++ b/migration/block-dirty-bitmap.c
ae23c9
@@ -600,6 +600,7 @@ static int dirty_bitmap_load_bits(QEMUFile *f, DirtyBitmapLoadState *s)
ae23c9
         ret = qemu_get_buffer(f, buf, buf_size);
ae23c9
         if (ret != buf_size) {
ae23c9
             error_report("Failed to read bitmap bits");
ae23c9
+            g_free(buf);
ae23c9
             return -EIO;
ae23c9
         }
ae23c9
 
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9