From 781f4657b91d6c8fa3dcf3bc9f0daaad5155506e Mon Sep 17 00:00:00 2001 From: Kinsey Moore Date: Fri, 4 May 2012 22:17:38 +0000 Subject: 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 --- main/features.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'main/features.c') diff --git a/main/features.c b/main/features.c index d9489592b..db6f1f366 100644 --- a/main/features.c +++ b/main/features.c @@ -5961,7 +5961,7 @@ static struct ast_parkinglot *build_parkinglot(const char *pl_name, struct ast_v static void process_applicationmap_line(struct ast_variable *var) { char *tmp_val = ast_strdupa(var->value); - char *activateon; + char *activateon, *new_syn; struct ast_call_feature *feature; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(exten); @@ -5972,10 +5972,10 @@ static void process_applicationmap_line(struct ast_variable *var) ); AST_STANDARD_APP_ARGS(args, tmp_val); - if (strchr(args.app, '(')) { + if ((new_syn = strchr(args.app, '('))) { /* New syntax */ args.moh_class = args.app_args; - args.app_args = strchr(args.app, '('); + args.app_args = new_syn; *args.app_args++ = '\0'; if (args.app_args[strlen(args.app_args) - 1] == ')') { args.app_args[strlen(args.app_args) - 1] = '\0'; -- cgit v1.2.3