if (!(menu = switch_core_alloc(pool, sizeof(*menu)))) {
if (newpool) {
switch_core_destroy_memory_pool(&pool);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
- return SWITCH_STATUS_MEMERR;
}
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
+ return SWITCH_STATUS_MEMERR;
}
menu->pool = pool;
switch_channel_t *channel;
switch_status_t status = SWITCH_STATUS_SUCCESS;
+ switch_assert(stack);
+
if (++stack->stack_count > 12) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Too many levels of recursion.\n");
switch_goto_status(SWITCH_STATUS_FALSE, end);
}
- if (!session || !stack || zstr(name)) {
+ if (!session || zstr(name)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid menu context\n");
switch_goto_status(SWITCH_STATUS_FALSE, end);
}
atoi(timeout),
strlen(max_failures) ? atoi(max_failures) : 0, strlen(max_timeouts) ? atoi(max_timeouts) : 0, xml_menu_ctx->pool);
+ switch_assert(menu);
if (!zstr(exec_on_max_fail)) {
menu->exec_on_max_fail = switch_core_strdup(menu->pool, exec_on_max_fail);
}
}
- if (status == SWITCH_STATUS_SUCCESS && menu != NULL) {
+ if (status == SWITCH_STATUS_SUCCESS) {
switch_xml_t xml_kvp;
/* build menu entries */