diff options
author | Jonathon Jongsma <jjongsma@redhat.com> | 2015-01-28 09:37:31 -0600 |
---|---|---|
committer | Fabiano FidĂȘncio <fidencio@redhat.com> | 2015-02-23 23:00:45 +0100 |
commit | f853caf341aa756ae2de7ff16f4eefc858214c3a (patch) | |
tree | aa1eac540ad175247a5c4516103b06f3b59cecf6 | |
parent | 1194fae687addae6e1c8399a1f42c6f57538f535 (diff) | |
download | spice-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.c | 3 |
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); |