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.
This commit is contained in:
Alon Levy 2015-08-11 20:48:03 +01:00 committed by Christophe Fergeau
parent 648808e282
commit a5ec6a2923

View File

@ -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])