diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2014-08-08 11:32:59 +0100 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2014-08-21 14:33:11 -0400 |
commit | 471eaa92934c9067311454f2069a1b4c98c7f4c8 (patch) | |
tree | c6b3241e8369cd9aa0a92818ad66d8363fd8fc09 /socket | |
parent | 948bdce717d3ba6132eb71c018f289de4095aca1 (diff) | |
download | libnice-471eaa92934c9067311454f2069a1b4c98c7f4c8.tar.gz |
socket: Gracefully return from send() if the socket is closed
Diffstat (limited to 'socket')
-rw-r--r-- | socket/udp-bsd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/socket/udp-bsd.c b/socket/udp-bsd.c index 304d945..7da760d 100644 --- a/socket/udp-bsd.c +++ b/socket/udp-bsd.c @@ -241,6 +241,10 @@ socket_send_message (NiceSocket *sock, const NiceAddress *to, GError *child_error = NULL; gssize len; + /* Socket has been closed: */ + if (priv == NULL) + return -1; + if (!nice_address_is_valid (&priv->niceaddr) || !nice_address_equal (&priv->niceaddr, to)) { union { |