aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-18 18:47:08 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-18 18:47:08 +0000
commit6b57591546cbc8e04981bc21477a3a234b35f9a7 (patch)
tree9c99132ed962fa0473ac69d4749ce4cc38d7ce10
parent9305379c74b4c88bacaac6f32c0aca4983bd4e50 (diff)
Merged revisions 165658 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r165658 | tilghman | 2008-12-18 12:36:48 -0600 (Thu, 18 Dec 2008) | 2 lines Fix 2 resource leaks and fix another pipe-to-comma conversion ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@165660 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_voicemail.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 08cefadf3..d1a030ce3 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -6210,7 +6210,6 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
int old_priority;
struct ast_app* directory_app;
-
directory_app = pbx_findapp("Directory");
if (directory_app) {
char vmcontext[256];
@@ -6220,7 +6219,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
old_priority = chan->priority;
/* call the the Directory, changes the channel */
- snprintf(vmcontext, sizeof(vmcontext), "%s||v", context ? context : "default");
+ snprintf(vmcontext, sizeof(vmcontext), "%s,,v", context ? context : "default");
res = pbx_exec(chan, directory_app, vmcontext);
ast_copy_string(username, chan->exten, sizeof(username));
@@ -6229,7 +6228,6 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
memcpy(chan->context, old_context, sizeof(chan->context));
memcpy(chan->exten, old_exten, sizeof(chan->exten));
chan->priority = old_priority;
-
} else {
ast_log(AST_LOG_WARNING, "Could not find the Directory application, disabling directory_forward\n");
ast_clear_flag((&globalflags), VM_DIRECFORWARD);
@@ -6255,6 +6253,14 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
AST_LIST_INSERT_HEAD(&extensions, receiver, list);
found++;
} else {
+ /* XXX Optimization for the future. When we encounter a single bad extension,
+ * bailing out on all of the extensions may not be the way to go. We should
+ * probably just bail on that single extension, then allow the user to enter
+ * several more. XXX
+ */
+ while ((receiver = AST_LIST_REMOVE_HEAD(&extensions, list))) {
+ free_user(receiver);
+ }
valid_extensions = 0;
break;
}
@@ -6269,10 +6275,9 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
return res;
}
} else {
- /* Dispose just in case */
- DISPOSE(fn, -1);
res = ast_say_digit_str(chan, s, ecodes, chan->language);
}
+ DISPOSE(fn, -1);
s = strsep(&stringp, "*");
}