diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index bfacdf89a6..0630963b4b 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -454,18 +454,18 @@ static void ivr_application_function(switch_core_session_t *session, char *data) && switch_ivr_menu_stack_xml_build(xml_ctx,&menu_stack,xml_menus,xml_menu) == SWITCH_STATUS_SUCCESS) { switch_xml_free(cxml); + cxml = NULL; switch_channel_pre_answer(channel); switch_ivr_menu_execute(session,menu_stack,params,NULL); switch_ivr_menu_stack_free(menu_stack); } else { - switch_xml_free(cxml); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to create menu '%s'\n", params); } } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to find menu '%s'\n", params); } } - + switch_xml_free(cxml); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", ivr_cf_name); }