From 14f48a6a7ab656ac0b104e2f528bdb28221b9d92 Mon Sep 17 00:00:00 2001 From: William King Date: Sat, 18 May 2013 16:34:46 -0700 Subject: [PATCH] Alice meet rabit hole. There is a leak here on every invite that comes back from a status 180 when the other side is not FS, but you have presence enabled. Thanks to Coverity scan for location this condition. This 'might' not have been leaking if sofia was automatically freeing this when the sofia object was destroyed, but all other locations where sip_header_as_string where called they were all followed by a su_free, so I assume not. --- src/mod/endpoints/mod_sofia/sofia.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 200901af34..d824e5eedd 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -5435,6 +5435,9 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + if ( full_contact ) { + su_free(nua_handle_home(tech_pvt->nh), full_contact); + } } } else if (status == 200 && (profile->pres_type)) { char *sql = NULL;