res_pjsip_session: Fix memory leak of direct media format capabilities
authorMatthew Jordan <mjordan@digium.com>
Thu, 21 Nov 2013 19:22:18 +0000 (19:22 +0000)
committerMatthew Jordan <mjordan@digium.com>
Thu, 21 Nov 2013 19:22:18 +0000 (19:22 +0000)
The direct media format capabilities are always allocated in
ast_sip_session_alloc and were not freed in the session destructor. Whoops.

(This being the third whoops caught by Scott and Nitesh's valgrind work for
the Asterisk Test Suite. Nifty!)
........

Merged revisions 402968 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402969 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_pjsip_session.c

index 4dae4b4..f44ec44 100644 (file)
@@ -1026,6 +1026,7 @@ static void session_destructor(void *obj)
        ast_party_id_free(&session->id);
        ao2_cleanup(session->endpoint);
        ast_format_cap_destroy(session->req_caps);
+       ast_format_cap_destroy(session->direct_media_cap);
 
        if (session->dsp) {
                ast_dsp_free(session->dsp);