smartcard: Fix SmartcardChannelClient creation

The wrong type (RED_TYPE_CHANNEL_CLIENT rather than
TYPE_SMARTCARD_CHANNEL_CLIENT) was used when creating a
SmartcardChannelClient, which meant the _init function was never called,
and SmartcardChannelClient::priv was never initialized.

This caused a crash when trying to connect with --spice-smartcard to a
VM with a smartcard channel configured.
This commit is contained in:
Christophe Fergeau 2016-11-21 14:30:52 +01:00
parent a31e18f264
commit 00d2c6f226

View File

@ -119,7 +119,7 @@ SmartCardChannelClient* smartcard_channel_client_create(RedChannel *channel,
g_array_append_vals(caps_array, caps, num_caps);
}
rcc = g_initable_new(RED_TYPE_CHANNEL_CLIENT,
rcc = g_initable_new(TYPE_SMARTCARD_CHANNEL_CLIENT,
NULL, NULL,
"channel", channel,
"client", client,