[asterisk-commits] tilghman: branch 1.6.1 r157255 - in /branches/1.6.1: ./ apps/app_dial.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 17 16:39:55 CST 2008


Author: tilghman
Date: Mon Nov 17 16:39:55 2008
New Revision: 157255

URL: http://svn.digium.com/view/asterisk?view=rev&rev=157255
Log:
Merged revisions 157253 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r157253 | tilghman | 2008-11-17 16:25:06 -0600 (Mon, 17 Nov 2008) | 8 lines
  
  Can't use items duplicated off the stack frame in an element returned from
  a function: in these cases, we have to use the heap, or garbage will result.
  (closes issue #13898)
   Reported by: alecdavis
   Patches: 
         20081114__bug13898__2.diff.txt uploaded by Corydon76 (license 14)
   Tested by: alecdavis
........

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/apps/app_dial.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.1/apps/app_dial.c?view=diff&rev=157255&r1=157254&r2=157255
==============================================================================
--- branches/1.6.1/apps/app_dial.c (original)
+++ branches/1.6.1/apps/app_dial.c Mon Nov 17 16:39:55 2008
@@ -962,7 +962,7 @@
 		play_to_caller = 1;
 
 	var = pbx_builtin_getvar_helper(chan, "LIMIT_WARNING_FILE");
-	config->warning_sound = !ast_strlen_zero(var) ? ast_strdupa(var) : "timeleft";
+	config->warning_sound = !ast_strlen_zero(var) ? ast_strdup(var) : ast_strdup("timeleft");
 
 	/* The code looking at config wants a NULL, not just "", to decide
 	 * that the message should not be played, so we replace "" with NULL.
@@ -971,10 +971,10 @@
 	 */
 
 	var = pbx_builtin_getvar_helper(chan, "LIMIT_TIMEOUT_FILE");
-	config->end_sound = !ast_strlen_zero(var) ? ast_strdupa(var) : NULL;
+	config->end_sound = !ast_strlen_zero(var) ? ast_strdup(var) : NULL;
 
 	var = pbx_builtin_getvar_helper(chan, "LIMIT_CONNECT_FILE");
-	config->start_sound = !ast_strlen_zero(var) ? ast_strdupa(var) : NULL;
+	config->start_sound = !ast_strlen_zero(var) ? ast_strdup(var) : NULL;
 
 	ast_channel_unlock(chan);
 
@@ -2060,6 +2060,15 @@
 	}
 
 done:
+	if (config.warning_sound) {
+		ast_free((char *)config.warning_sound);
+	}
+	if (config.end_sound) {
+		ast_free((char *)config.end_sound);
+	}
+	if (config.start_sound) {
+		ast_free((char *)config.start_sound);
+	}
 	return res;
 }
 




More information about the asterisk-commits mailing list