[asterisk-commits] oej: branch 1.6.2 r287470 - in /branches/1.6.2: ./ main/manager.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Sep 19 11:06:15 CDT 2010


Author: oej
Date: Sun Sep 19 11:06:10 2010
New Revision: 287470

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=287470
Log:
Merged revisions 287469 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r287469 | oej | 2010-09-19 17:56:50 +0200 (Sön, 19 Sep 2010) | 7 lines
  
  Make sure we always free variables properly in manager originate.
  
  (closes issue #17891)
  reported, solved and tested by oej
  
  Review: https://reviewboard.asterisk.org/r/869/
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/main/manager.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: branches/1.6.2/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/manager.c?view=diff&rev=287470&r1=287469&r2=287470
==============================================================================
--- branches/1.6.2/main/manager.c (original)
+++ branches/1.6.2/main/manager.c Sun Sep 19 11:06:10 2010
@@ -2449,7 +2449,7 @@
 	const char *async = astman_get_header(m, "Async");
 	const char *id = astman_get_header(m, "ActionID");
 	const char *codecs = astman_get_header(m, "Codecs");
-	struct ast_variable *vars = astman_get_variables(m);
+	struct ast_variable *vars;
 	char *tech, *data;
 	char *l = NULL, *n = NULL;
 	int pi = 0;
@@ -2498,6 +2498,9 @@
 		format = 0;
 		ast_parse_allow_disallow(NULL, &format, codecs, 1);
 	}
+	/* Allocate requested channel variables */
+	vars = astman_get_variables(m);
+
 	if (ast_true(async)) {
 		struct fast_originate_helper *fast = ast_calloc(1, sizeof(*fast));
 		if (!fast) {
@@ -2549,6 +2552,9 @@
 			res = ast_pbx_outgoing_exten(tech, format, data, to, context, exten, pi, &reason, 1, l, n, vars, account, NULL);
 		else {
 			astman_send_error(s, m, "Originate with 'Exten' requires 'Context' and 'Priority'");
+			if (vars) {
+				ast_variables_destroy(vars);
+			}
 			return 0;
 		}
 	}




More information about the asterisk-commits mailing list