yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From e8cafbffc5f3363548c13cc237883a3346cff1cf Mon Sep 17 00:00:00 2001
From: Orit Wasserman <owasserm@redhat.com>
Date: Tue, 11 Feb 2014 14:56:36 +0100
Subject: [PATCH 17/28] Set xbzrle buffers to NULL after freeing them to avoid double free errors

RH-Author: Orit Wasserman <owasserm@redhat.com>
Message-id: <1392130597-23600-2-git-send-email-owasserm@redhat.com>
Patchwork-id: 57212
O-Subject: [RHEL7 qemu-kvm PATCH 1/2] Set xbzrle buffers to NULL after freeing them to avoid double free errors
Bugzilla: 1038540
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
RH-Acked-by: Juan Quintela <quintela@redhat.com>

Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
(cherry picked from commit f6c6483b259a2395ee44cfa966f622e0f2dbe2ae)
---
 arch_init.c | 3 +++
 1 file changed, 3 insertions(+)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 arch_init.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch_init.c b/arch_init.c
index 0aacdac..65148d6 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -623,6 +623,9 @@ static void migration_end(void)
         g_free(XBZRLE.current_buf);
         g_free(XBZRLE.decoded_buf);
         XBZRLE.cache = NULL;
+        XBZRLE.encoded_buf = NULL;
+        XBZRLE.current_buf = NULL;
+        XBZRLE.decoded_buf = NULL;
     }
 }
 
-- 
1.7.1