diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-08 02:00:45 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-08 02:00:45 +0000 |
commit | dad1faf4ae07594cc278a7e89729b2d5a16e6485 (patch) | |
tree | 3bfeeffcb2a22e44f85759c00788986b85e5d55d | |
parent | 17b99c8c7c05646c9eff400674a405a9f71a3ae1 (diff) |
Destroy msg_cfg after it's used, not before (issue #7618 reported by wvolz with minor mods)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@42373 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | apps/app_voicemail.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 95d967423..27d58534f 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -7504,7 +7504,6 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s context = ast_variable_retrieve(msg_cfg, "message", "context"); if (!strncasecmp("macro",context,5)) /* Macro names in contexts are useless for our needs */ context = ast_variable_retrieve(msg_cfg, "message","macrocontext"); - ast_config_destroy(msg_cfg); #endif switch (option) { case 3: @@ -7528,8 +7527,10 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s if (num) { /* Dial the CID number */ res = dialout(chan, vmu, num, vmu->callback); - if (res) + if (res) { + ast_config_destroy(msg_cfg); return 9; + } } else { res = '2'; } @@ -7539,13 +7540,16 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s /* Want to enter a different number, can only do this if there's a dialout context for this user */ if (!ast_strlen_zero(vmu->dialout)) { res = dialout(chan, vmu, NULL, vmu->dialout); - if (res) + if (res) { + ast_config_destroy(msg_cfg); return 9; + } } else { if (option_verbose > 2) ast_verbose( VERBOSE_PREFIX_3 "Caller can not specify callback number - no dialout context available\n"); res = ast_play_and_wait(chan, "vm-sorry"); } + ast_config_destroy(msg_cfg); return res; case '*': res = 't'; @@ -7613,6 +7617,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s ast_verbose(VERBOSE_PREFIX_3 "No CID number available, no reply sent\n"); if (!res) res = ast_play_and_wait(chan, "vm-nonumber"); + ast_config_destroy(msg_cfg); return res; } else { if (find_user(NULL, vmu->context, num)) { @@ -7628,6 +7633,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s res = leave_voicemail(chan, mailbox, &leave_options); if (!res) res = 't'; + ast_config_destroy(msg_cfg); return res; } else { /* Sender has no mailbox, can't reply */ @@ -7635,6 +7641,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s ast_verbose( VERBOSE_PREFIX_3 "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context); ast_play_and_wait(chan, "vm-nobox"); res = 't'; + ast_config_destroy(msg_cfg); return res; } } |