Fix many issues from the NULL_RETURNS Coverity report

Most of the changes here are trivial NULL checks.  There are a couple
optimizations to remove the need to check for NULL and outboundproxy parsing
in chan_sip.c was rewritten to avoid use of strtok.  Additionally, a bug was
found and fixed with the parsing of outboundproxy when "outboundproxy=," was
set.

(Closes issue ASTERISK-19654)
........

Merged revisions 365398 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 365399 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2012-05-04 22:17:38 +00:00
parent 8842f76a7f
commit 781f4657b9
11 changed files with 124 additions and 58 deletions

View File

@@ -764,8 +764,15 @@ static int handle_gosub(struct ast_channel *chan, AGI *agi, int argc, const char
struct ast_pbx *pbx = ast_channel_pbx(chan);
struct ast_pbx_args args;
struct ast_datastore *stack_store = ast_channel_datastore_find(chan, &stack_info, NULL);
AST_LIST_HEAD(,gosub_stack_frame) *oldlist = stack_store->data;
struct gosub_stack_frame *cur = AST_LIST_FIRST(oldlist);
AST_LIST_HEAD(,gosub_stack_frame) *oldlist;
struct gosub_stack_frame *cur;
if (!stack_store) {
ast_log(LOG_WARNING, "No GoSub stack remaining after AGI GoSub execution.\n");
ast_free(gosub_args);
return RESULT_FAILURE;
}
oldlist = stack_store->data;
cur = AST_LIST_FIRST(oldlist);
cur->is_agi = 1;
memset(&args, 0, sizeof(args));