char-device: Avoid use-after-free

Reset pointer after freeing the structure pointing to it.

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
Christophe Fergeau 2016-03-30 17:38:13 +01:00 committed by Frediano Ziglio
parent 61d41688d4
commit fe3d5d542d

View File

@ -211,6 +211,7 @@ static void spice_char_device_client_free(SpiceCharDeviceState *dev,
if (dev_client->wait_for_tokens_timer) {
reds_core_timer_remove(dev->priv->reds, dev_client->wait_for_tokens_timer);
dev_client->wait_for_tokens_timer = NULL;
}
spice_char_device_client_send_queue_free(dev, dev_client);