From: Anthony Minessale Date: Mon, 29 Oct 2012 19:38:37 +0000 (-0500) Subject: fix some sql mem leaks. regression from recent refactor X-Git-Tag: v1.3.1~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de5f0c5144f240f39a965e04942c56a6cbc3a150;p=thirdparty%2Ffreeswitch.git fix some sql mem leaks. regression from recent refactor --- diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index e7f6a2fbdc..3e0e3965fe 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -717,6 +717,8 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot) } sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_reg_del_callback, profile); + free(sql); + if (now) { sql = switch_mprintf("delete from sip_registrations where expires > 0 and expires <= %ld and hostname='%q'", (long) now, mod_sofia_globals.hostname); @@ -733,6 +735,8 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot) "and profile_name='%s' and expires <= %ld", mod_sofia_globals.hostname, profile->name, (long) now); sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_sla_dialog_del_callback, profile); + free(sql); + sql = switch_mprintf("delete from sip_shared_appearance_dialogs where expires > 0 and hostname='%q' and expires <= %ld", mod_sofia_globals.hostname, (long) now); @@ -944,6 +948,7 @@ switch_console_callback_match_t *sofia_reg_find_reg_url_with_positive_expires_mu } sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_reg_find_reg_with_positive_expires_callback, &cbt); + free(sql); return cbt.list; }