diff options
author | Olle Johansson <oej@edvina.net> | 2010-09-19 16:12:08 +0000 |
---|---|---|
committer | Olle Johansson <oej@edvina.net> | 2010-09-19 16:12:08 +0000 |
commit | 3478cfffcacdb249af627c3d8aa2177c45c72695 (patch) | |
tree | c808be59d022651f0aacbff7a119357f64fba6a2 /main/manager.c | |
parent | b717decec65f6f11cdd479368629ceb1f76ac5b3 (diff) |
Merged revisions 287471 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
................
r287471 | oej | 2010-09-19 18:09:28 +0200 (Sön, 19 Sep 2010) | 21 lines
Merged revisions 287470 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2
................
r287470 | oej | 2010-09-19 18:06:10 +0200 (Sön, 19 Sep 2010) | 14 lines
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/
........
................
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@287472 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/manager.c')
-rw-r--r-- | main/manager.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/main/manager.c b/main/manager.c index 7ec42a77c..d3c46d122 100644 --- a/main/manager.c +++ b/main/manager.c @@ -3814,7 +3814,7 @@ static int action_originate(struct mansession *s, const struct message *m) 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; @@ -3865,6 +3865,9 @@ static int action_originate(struct mansession *s, const struct message *m) 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) { @@ -3918,6 +3921,9 @@ static int action_originate(struct mansession *s, const struct message *m) 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; } } |