Patchwork [3/8] Set xbzrle buffers to NULL after freeing them to avoid double free errors

login
register
mail settings
Submitter Juan Quintela
Date Feb. 4, 2014, 3:55 p.m.
Message ID <1391529334-30526-4-git-send-email-quintela@redhat.com>
Download mbox | patch
Permalink /patch/316743/
State New
Headers show

Comments

Juan Quintela - Feb. 4, 2014, 3:55 p.m.
From: Orit Wasserman <owasserm@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>
---
 arch_init.c | 3 +++
 1 file changed, 3 insertions(+)

Patch

diff --git a/arch_init.c b/arch_init.c
index 77912e7..66f5e82 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -617,6 +617,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;
     }
 }