Blame SOURCES/0076-spicevmc-set-state-of-DeviceInstance-to-NULL.patch

e2c81d
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
e2c81d
From: Victor Toso <victortoso@redhat.com>
e2c81d
Date: Fri, 13 Nov 2015 10:46:43 +0100
e2c81d
Subject: [PATCH] spicevmc: set state of DeviceInstance to NULL
e2c81d
e2c81d
After spice_char_device_state_destroy is called spicevmc should not keep
e2c81d
reference to that memory. state->chardev_st and sin->st point to the
e2c81d
same SpiceCharDeviceState and both should be set to NULL when it is
e2c81d
destroyed.
e2c81d
---
e2c81d
 server/spicevmc.c | 1 +
e2c81d
 1 file changed, 1 insertion(+)
e2c81d
e2c81d
diff --git a/server/spicevmc.c b/server/spicevmc.c
e2c81d
index e10f183..94cb8a7 100644
e2c81d
--- a/server/spicevmc.c
e2c81d
+++ b/server/spicevmc.c
e2c81d
@@ -559,6 +559,7 @@ void spicevmc_device_disconnect(SpiceCharDeviceInstance *sin)
e2c81d
     }
e2c81d
     spice_char_device_state_destroy(sin->st);
e2c81d
     state->chardev_st = NULL;
e2c81d
+    sin->st = NULL;
e2c81d
 
e2c81d
     reds_unregister_channel(&state->channel);
e2c81d
     free(state->pipe_item);