diff options
author | Alon Levy <alon@pobox.com> | 2015-08-11 20:48:03 +0100 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2015-08-12 10:28:57 +0200 |
commit | a5ec6a29231884162a7003ddefdc0d52d4f9126b (patch) | |
tree | b7fe5d7c1f2e47e9289f0ef7bdf1c4c056467e00 /server | |
parent | 648808e282341a98f10df287331729fc1c3e2a08 (diff) | |
download | spice-a5ec6a29231884162a7003ddefdc0d52d4f9126b.tar.gz spice-a5ec6a29231884162a7003ddefdc0d52d4f9126b.tar.xz spice-a5ec6a29231884162a7003ddefdc0d52d4f9126b.zip |
server/inputs_channel: Cope with NULL keyboard in release_keys()
This fixes a test_display_no_ssl segfault on client disconnect when
the keyboard was never initialized.
Diffstat (limited to 'server')
-rw-r--r-- | server/inputs_channel.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/inputs_channel.c b/server/inputs_channel.c index b0ba1d66..29345725 100644 --- a/server/inputs_channel.c +++ b/server/inputs_channel.c @@ -483,7 +483,12 @@ static int inputs_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, ui static void inputs_release_keys(void) { int i; - SpiceKbdState *st = keyboard->st; + SpiceKbdState *st; + + if (!keyboard) { + return; + } + st = keyboard->st; for (i = 0; i < SPICE_N_ELEMENTS(st->key); i++) { if (!st->key[i]) |