Index: pbx/pbx_spool.c =================================================================== --- pbx/pbx_spool.c (revision 143404) +++ pbx/pbx_spool.c (working copy) @@ -101,6 +101,9 @@ static void free_outgoing(struct outgoing *o) { + if (o->vars) { + ast_variables_destroy(o->vars); + } ast_free(o); } @@ -324,9 +327,11 @@ if (!ast_strlen_zero(o->app)) { ast_verb(3, "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries); res = ast_pbx_outgoing_app(o->tech, o->format, o->dest, o->waittime * 1000, o->app, o->data, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL); + o->vars = NULL; } else { ast_verb(3, "Attempting call on %s/%s for %s@%s:%d (Retry %d)\n", o->tech, o->dest, o->exten, o->context,o->priority, o->retries); res = ast_pbx_outgoing_exten(o->tech, o->format, o->dest, o->waittime * 1000, o->context, o->exten, o->priority, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL); + o->vars = NULL; } if (res) { ast_log(LOG_NOTICE, "Call failed to go through, reason (%d) %s\n", reason, ast_channel_reason2str(reason)); Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 143404) +++ channels/chan_sip.c (working copy) @@ -5666,6 +5666,8 @@ /* Set channel variables for this call from configuration */ for (v = i->chanvars ; v ; v = v->next) pbx_builtin_setvar_helper(tmp, v->name, v->value); + ast_variables_destroy(i->chanvars); + i->chanvars = NULL; if (state != AST_STATE_DOWN && ast_pbx_start(tmp)) { ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);