[PATCH] smartcard: Avoid crash on remove_interface call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



SpiceCharDeviceInstance is not a GObject, the GObject is char_device->st
as the above line is stating.
The crash never happen as Qemu never calls spice_server_remove_interface
for smartcards.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/smartcard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/smartcard.c b/server/smartcard.c
index 7a34080..872aa1d 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -274,7 +274,7 @@ void smartcard_device_disconnect(SpiceCharDeviceInstance *char_device)
 {
     g_return_if_fail(RED_IS_CHAR_DEVICE_SMARTCARD(char_device->st));
 
-    g_object_unref(char_device);
+    g_object_unref(char_device->st);
 }
 
 RedCharDevice *smartcard_device_connect(RedsState *reds, SpiceCharDeviceInstance *char_device)
-- 
2.7.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]