From 00d2c6f22669d1886d50dc4c413c1b954dfbc600 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Mon, 21 Nov 2016 14:30:52 +0100 Subject: [PATCH] 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. --- server/smartcard-channel-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/smartcard-channel-client.c b/server/smartcard-channel-client.c index d00a6b23..14fea4fd 100644 --- a/server/smartcard-channel-client.c +++ b/server/smartcard-channel-client.c @@ -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,