https://origsvn.digium.com/svn/asterisk/trunk
........
r220365 | dvossel | 2009-09-24 15:37:20 -0500 (Thu, 24 Sep 2009) | 8 lines
fixes tcptls_session memory leak caused by ref count error
(closes issue #15939)
Reported by: dvossel
Review: https://reviewboard.asterisk.org/r/375/
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@220372
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
__ssl_setup(desc->tls_cfg, 1);
}
- ao2_ref(tcptls_session, +1);
if (!ast_make_file_from_fd(tcptls_session))
goto error;
* creates a FILE * from the fd passed by the accept thread.
* This operation is potentially expensive (certificate verification),
* so we do it in the child thread context.
+*
+* \note must decrement ref count before returning NULL on error
*/
void *ast_make_file_from_fd(void *data)
{
if (peer)
X509_free(peer);
fclose(tcptls_session->f);
+ ao2_ref(tcptls_session, -1);
return NULL;
}
}