improved memory behavior of some plugins during shutdown

This commit is contained in:
Thomas Ries 2017-02-27 20:15:51 +00:00
parent 962f5382c8
commit fe15a9316b
2 changed files with 19 additions and 0 deletions

View File

@ -117,6 +117,15 @@ int PLUGIN_PROCESS(int stage, sip_ticket_t *ticket){
/* De-Initialization */
int PLUGIN_END(plugin_def_t *plugin_def){
int i;
int num_entries;
/* free space for regexes */
num_entries = plugin_cfg.regex_pattern.used;
for (i=0; i < num_entries; i++) {
regfree(&re[i]);
}
free(re);
return STS_SUCCESS;
}

View File

@ -116,6 +116,16 @@ int PLUGIN_PROCESS(int stage, sip_ticket_t *ticket){
* connections, whatever the plugin messes around with)
*/
int PLUGIN_END(plugin_def_t *plugin_def){
int i;
int num_entries;
/* free space for regexes */
num_entries = plugin_cfg.trunk_numbers_regex.used;
for (i=0; i < num_entries; i++) {
regfree(&re[i]);
}
free(re);
return STS_SUCCESS;
}