From 8741cc7fb730b39242491ed997c5be89c460d98d Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Fri, 30 Aug 2013 01:19:26 +0000 Subject: [PATCH] pbx.c: Make pbx_substitute_variables_helper_full() not mask variables. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397977 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/pbx.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/main/pbx.c b/main/pbx.c index fa2f645947..09f3d95ec7 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -4479,11 +4479,12 @@ void pbx_substitute_variables_helper_full(struct ast_channel *c, struct varshead /* Substitute if necessary */ if (needsub) { - size_t used; - if (!ltmp) - ltmp = ast_alloca(VAR_BUF_SIZE); + size_t my_used; - pbx_substitute_variables_helper_full(c, headp, var, ltmp, VAR_BUF_SIZE - 1, &used); + if (!ltmp) { + ltmp = ast_alloca(VAR_BUF_SIZE); + } + pbx_substitute_variables_helper_full(c, headp, var, ltmp, VAR_BUF_SIZE - 1, &my_used); vars = ltmp; } else { vars = var; @@ -4568,11 +4569,12 @@ void pbx_substitute_variables_helper_full(struct ast_channel *c, struct varshead /* Substitute if necessary */ if (needsub) { - size_t used; - if (!ltmp) - ltmp = ast_alloca(VAR_BUF_SIZE); + size_t my_used; - pbx_substitute_variables_helper_full(c, headp, var, ltmp, VAR_BUF_SIZE - 1, &used); + if (!ltmp) { + ltmp = ast_alloca(VAR_BUF_SIZE); + } + pbx_substitute_variables_helper_full(c, headp, var, ltmp, VAR_BUF_SIZE - 1, &my_used); vars = ltmp; } else { vars = var;