[asterisk-commits] mmichelson: trunk r369733 - in /trunk: ./ main/tcptls.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jul 6 13:49:20 CDT 2012
Author: mmichelson
Date: Fri Jul 6 13:49:17 2012
New Revision: 369733
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=369733
Log:
Remove a superfluous and dangerous freeing of an SSL_CTX.
The problem here is that multiple server sessions share
a SSL_CTX. When one session ended, the SSL_CTX would be
freed and set NULL, leaving the other sessions unable to
function.
The code being removed is superfluous because the SSL_CTX
structures for servers will be properly freed when ast_ssl_teardown
is called.
(closes issue ASTERISK-20074)
Reported by Trevor Helmsley
Patches:
ASTERISK-20074.diff uploaded by Mark Michelson (license #5049)
Testers:
Trevor Helmsley
........
Merged revisions 369731 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 369732 from http://svn.asterisk.org/svn/asterisk/branches/10
Modified:
trunk/ (props changed)
trunk/main/tcptls.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.
Modified: trunk/main/tcptls.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/tcptls.c?view=diff&rev=369733&r1=369732&r2=369733
==============================================================================
--- trunk/main/tcptls.c (original)
+++ trunk/main/tcptls.c Fri Jul 6 13:49:17 2012
@@ -133,14 +133,6 @@
}
#endif
return write(tcptls_session->fd, buf, count);
-}
-
-static void session_instance_destructor(void *obj)
-{
- struct ast_tcptls_session_instance *i = obj;
- if (i->parent && i->parent->tls_cfg) {
- ast_ssl_teardown(i->parent->tls_cfg);
- }
}
/*! \brief
@@ -291,7 +283,7 @@
}
continue;
}
- tcptls_session = ao2_alloc(sizeof(*tcptls_session), session_instance_destructor);
+ tcptls_session = ao2_alloc(sizeof(*tcptls_session), NULL);
if (!tcptls_session) {
ast_log(LOG_WARNING, "No memory for new session: %s\n", strerror(errno));
if (close(fd)) {
@@ -505,7 +497,7 @@
}
}
- if (!(tcptls_session = ao2_alloc(sizeof(*tcptls_session), session_instance_destructor))) {
+ if (!(tcptls_session = ao2_alloc(sizeof(*tcptls_session), NULL))) {
goto error;
}
More information about the asterisk-commits
mailing list