From f718a0572f185a3634431924ae46d0877c197898 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 dac459c774..88b014c9be 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -5491,6 +5491,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;