diff options
author | Jonathan Rose <jrose@digium.com> | 2011-11-30 21:10:38 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2011-11-30 21:10:38 +0000 |
commit | 6fa827b5d0f0c071b92be4047fa6b4f008e1e200 (patch) | |
tree | 141401c350fcf5583cb3c6ab22012cbff35a245d /include/asterisk | |
parent | cb21847e0377ef844bc8f075e0605ac5d5c84aa9 (diff) |
Cleaning up chan_sip/tcptls file descriptor closing.
This patch attempts to eliminate various possible instances of undefined behavior caused
by invoking close/fclose in situations where fclose may have already been issued on a
tcptls_session_instance and/or closing file descriptors that don't have a valid index
for fd (-1). Thanks for more than a little help from wdoekes.
(closes issue ASTERISK-18700)
Reported by: Erik Wallin
(issue ASTERISK-18345)
Reported by: Stephane Cazelas
(issue ASTERISK-18342)
Reported by: Stephane Chazelas
Review: https://reviewboard.asterisk.org/r/1576/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/tcptls.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/asterisk/tcptls.h b/include/asterisk/tcptls.h index 6f187b20b..e9b2371fb 100644 --- a/include/asterisk/tcptls.h +++ b/include/asterisk/tcptls.h @@ -177,6 +177,13 @@ struct ast_tcptls_session_instance *ast_tcptls_client_create(struct ast_tcptls_s void *ast_tcptls_server_root(void *); /*! + * \brief Closes a tcptls session instance's file and/or file descriptor. + * The tcptls_session will be set to NULL and it's file descriptor will be set to -1 + * by this function. + */ +void ast_tcptls_close_session_file(struct ast_tcptls_session_instance *tcptls_session); + +/*! * \brief This is a generic (re)start routine for a TCP server, * which does the socket/bind/listen and starts a thread for handling * accept(). |