Commit 471eaa92 authored by Philip Withnall's avatar Philip Withnall Committed by Olivier Crête

socket: Gracefully return from send() if the socket is closed

parent 948bdce7
...@@ -241,6 +241,10 @@ socket_send_message (NiceSocket *sock, const NiceAddress *to, ...@@ -241,6 +241,10 @@ socket_send_message (NiceSocket *sock, const NiceAddress *to,
GError *child_error = NULL; GError *child_error = NULL;
gssize len; gssize len;
/* Socket has been closed: */
if (priv == NULL)
return -1;
if (!nice_address_is_valid (&priv->niceaddr) || if (!nice_address_is_valid (&priv->niceaddr) ||
!nice_address_equal (&priv->niceaddr, to)) { !nice_address_equal (&priv->niceaddr, to)) {
union { union {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment