mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2025-12-26 14:18:36 +00:00
marshaller: Fix a possible leak
The possible file descriptor associated to the message (currently can be only the DRM descriptor from Virgl) is not freed in case the marshaller is reset/destroyed. This can happen connecting/disconnecting client. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
5110dbcbb7
commit
16deca6f1c
@ -210,6 +210,12 @@ void spice_marshaller_reset(SpiceMarshaller *m)
|
||||
m->next = NULL;
|
||||
m->n_items = 0;
|
||||
m->total_size = 0;
|
||||
if (m->has_fd) {
|
||||
m->has_fd = false;
|
||||
if (m->fd != -1) {
|
||||
close(m->fd);
|
||||
}
|
||||
}
|
||||
|
||||
d = m->data;
|
||||
d->last_marshaller = d->marshallers;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user