diff --git a/src/mod/applications/mod_cidlookup/mod_cidlookup.c b/src/mod/applications/mod_cidlookup/mod_cidlookup.c index 7df22fb3ef..55d7aa0d90 100644 --- a/src/mod/applications/mod_cidlookup/mod_cidlookup.c +++ b/src/mod/applications/mod_cidlookup/mod_cidlookup.c @@ -845,6 +845,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_cidlookup_load) Macro expands to: switch_status_t mod_cidlookup_shutdown() */ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cidlookup_shutdown) { + switch_xml_config_cleanup(instructions); switch_event_unbind(&reload_xml_event); return SWITCH_STATUS_SUCCESS; } diff --git a/src/switch_xml_config.c b/src/switch_xml_config.c index 6d67ccdad4..a208a6168e 100644 --- a/src/switch_xml_config.c +++ b/src/switch_xml_config.c @@ -457,7 +457,7 @@ SWITCH_DECLARE(void) switch_xml_config_cleanup(switch_xml_config_item_t *instruc char **ptr = (char **) item->ptr; switch_xml_config_string_options_t *string_options = (switch_xml_config_string_options_t *) item->data; /* if (using_strdup) */ - if (string_options && !string_options->pool && !string_options->length) { + if (!string_options || (!string_options->pool && !string_options->length)) { switch_safe_free(*ptr); } }