]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix leak in xml ivr menus FSCORE-421
authorMathieu Rene <mrene@avgs.ca>
Thu, 20 Aug 2009 17:41:48 +0000 (17:41 +0000)
committerMathieu Rene <mrene@avgs.ca>
Thu, 20 Aug 2009 17:41:48 +0000 (17:41 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14579 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_menu.c

index f306b29d6b3f10704a1ae2694b69653f09763926..d16aa57e1b3d90174c3fb77b422f923232198d28 100644 (file)
@@ -793,10 +793,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_build(switch_ivr_menu_
                                                                          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) {