From: William King Date: Sat, 18 May 2013 23:34:46 +0000 (-0700) Subject: Alice meet rabit hole. There is a leak here on every invite that comes back from... X-Git-Tag: v1.2.10~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14f48a6a7ab656ac0b104e2f528bdb28221b9d92;p=thirdparty%2Ffreeswitch.git 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. --- 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;