[asterisk-dev] [Code Review] tcptls_session memory leak

David Vossel dvossel at digium.com
Wed Sep 23 11:19:16 CDT 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/375/
-----------------------------------------------------------

(Updated 2009-09-23 11:19:16.809525)


Review request for Asterisk Developers.


Changes
-------

addresses Russell's comments. 


Summary
-------

In tcptls.c, a client tcptls_session is allocated in ast_tcptls_client_start().  The session is created using ao2_alloc() which returns an ao2 object containing the data as well as a single reference.  In that same function an additional reference is given to the tcptls_session right before the handle_tls_connection() function is called.  The handle_tls_connection() function does not handle this reference at all, except for dereferencing the tcptls_session in one error case, so it doesn't appear the extra ref is necessary.  This results in a memory leak in chan_sip for every new client tcptls_session.


This addresses bug 15939.
    https://issues.asterisk.org/view.php?id=15939


Diffs (updated)
-----

  /trunk/main/tcptls.c 219892 

Diff: https://reviewboard.asterisk.org/r/375/diff


Testing
-------

I placed a debug message in the tcptls destructor function verifying it is destroyed correctly.  Before this change, the destructor was never called.


Thanks,

David




More information about the asterisk-dev mailing list