Revision
14579
Author
mrene
Date
2009-08-20 12:41:48 -0500 (Thu, 20 Aug 2009)

Log Message

Fix leak in xml ivr menus FSCORE-421

Modified Paths

Diff

Modified: freeswitch/trunk/src/switch_ivr_menu.c (14578 => 14579)


--- freeswitch/trunk/src/switch_ivr_menu.c	2009-08-20 17:39:13 UTC (rev 14578)
+++ freeswitch/trunk/src/switch_ivr_menu.c	2009-08-20 17:41:48 UTC (rev 14579)
@@ -793,10 +793,14 @@
 									  atoi(timeout), 
 									  strlen(max_failures)? atoi(max_failures): 0, 
 									  strlen(max_timeouts)? atoi(max_timeouts): 0, 
-									  xml_menu_ctx->pool);
+									  xml_menu_ctx->pool);									
 		/* set the menu_stack for the caller */
 		if (status == SWITCH_STATUS_SUCCESS && *menu_stack == NULL) {
 			*menu_stack = menu;
+			
+			if (xml_menu_ctx->autocreated) {
+				switch_set_flag(menu, SWITCH_IVR_MENU_FLAG_FREEPOOL);
+			}
 		}
 
 		if (status == SWITCH_STATUS_SUCCESS && menu != NULL) {