summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Toso <victortoso@redhat.com>2015-11-13 10:46:43 +0100
committerVictor Toso <victortoso@redhat.com>2015-11-13 12:01:26 +0100
commit08230ee1715ff07bb0bdc8e6661b53a6752854d5 (patch)
treede64bcbfdaf2439c373c875de9aa1c4da40b723f
parentc429574bb6aebcbbddcc9714f994afd6b0ae7186 (diff)
downloadspice-08230ee1715ff07bb0bdc8e6661b53a6752854d5.zip
spice-08230ee1715ff07bb0bdc8e6661b53a6752854d5.tar.gz
spice-08230ee1715ff07bb0bdc8e6661b53a6752854d5.tar.xz
spicevmc: set state of DeviceInstance to NULL
After spice_char_device_state_destroy is called spicevmc should not keep reference to that memory. state->chardev_st and sin->st point to the same SpiceCharDeviceState and both should be set to NULL when it is destroyed.
-rw-r--r--server/spicevmc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/server/spicevmc.c b/server/spicevmc.c
index 6ac1561..d37b1ec 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -559,6 +559,7 @@ void spicevmc_device_disconnect(SpiceCharDeviceInstance *sin)
}
spice_char_device_state_destroy(sin->st);
state->chardev_st = NULL;
+ sin->st = NULL;
reds_unregister_channel(&state->channel);
free(state->pipe_item);