summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2015-01-28 09:37:31 -0600
committerFabiano FidĂȘncio <fidencio@redhat.com>2015-02-23 23:00:45 +0100
commitf853caf341aa756ae2de7ff16f4eefc858214c3a (patch)
treeaa1eac540ad175247a5c4516103b06f3b59cecf6
parent1194fae687addae6e1c8399a1f42c6f57538f535 (diff)
downloadspice-f853caf341aa756ae2de7ff16f4eefc858214c3a.tar.gz
spice-f853caf341aa756ae2de7ff16f4eefc858214c3a.tar.xz
spice-f853caf341aa756ae2de7ff16f4eefc858214c3a.zip
spice_server_remove_interface: use local variable
We were accidentally setting the global 'reds' variable in one of the branches in this function when we wanted to set the local variable.
-rw-r--r--server/reds.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/reds.c b/server/reds.c
index 9bf0e947..91d2ffbc 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3151,11 +3151,12 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *s,
SPICE_GNUC_VISIBLE int spice_server_remove_interface(SpiceBaseInstance *sin)
{
+ RedsState *reds;
const SpiceBaseInterface *interface = sin->sif;
if (strcmp(interface->type, SPICE_INTERFACE_TABLET) == 0) {
SpiceTabletInstance *tablet = SPICE_CONTAINEROF(sin, SpiceTabletInstance, base);
- RedsState *reds = spice_tablet_state_get_server(tablet->st);
+ reds = spice_tablet_state_get_server(tablet->st);
g_return_val_if_fail(reds != NULL, -1);
spice_info("remove SPICE_INTERFACE_TABLET");
inputs_channel_detach_tablet(reds->inputs_channel, tablet);