mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-25 01:11:15 +00:00
reds: Fix leaks if reds_init_client_ssl_connection fails
If a client is unable to complete the TLS handshake phase reds_init_client_ssl_connection leaked some memory as the stream is not correctly freed. This also causes the stream to send the SPICE_CHANNEL_EVENT_DISCONNECTED event. Otherwise only SPICE_CHANNEL_EVENT_CONNECTED was sent. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
8856d518ee
commit
2e06a6e940
@ -2503,9 +2503,10 @@ static RedLinkInfo *reds_init_client_ssl_connection(RedsState *reds, int socket)
|
||||
return link;
|
||||
|
||||
error:
|
||||
free(link->stream);
|
||||
BN_free(link->tiTicketing.bn);
|
||||
free(link);
|
||||
/* close the stream but do not close the socket, this API is
|
||||
* supposed to not close it if it fails */
|
||||
link->stream->socket = -1;
|
||||
reds_link_free(link);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user