From 68bbad730df7266f2c86515297b542d07f124627 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 28 Aug 2008 02:21:21 +0000 Subject: [PATCH] fix handling of error cases in voicemail_inject (MODAPP-133) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9374 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_voicemail/mod_voicemail.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 9fbc59eef5..f284d6885b 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -2141,6 +2141,7 @@ static switch_status_t voicemail_inject(const char *data) if ((argc = switch_separate_string(dup, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) < 2) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "not enough args [%s]\n", data); + status = SWITCH_STATUS_FALSE; goto end; } @@ -2166,6 +2167,7 @@ static switch_status_t voicemail_inject(const char *data) if (!(user && domain)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid syntax [%s][%s]\n", switch_str_nil(user), switch_str_nil(domain)); + status = SWITCH_STATUS_FALSE; goto end; } @@ -2175,6 +2177,7 @@ static switch_status_t voicemail_inject(const char *data) if (!profile) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find profile\n"); + status = SWITCH_STATUS_FALSE; } else { switch_xml_t x_domain, xml_root; switch_event_t *my_params = NULL; @@ -2187,6 +2190,7 @@ static switch_status_t voicemail_inject(const char *data) if (switch_xml_locate_domain(domain, my_params, &xml_root, &x_domain) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot locate domain %s\n", domain); + status = SWITCH_STATUS_FALSE; switch_event_destroy(&my_params); goto end; }