From dd81b047dbf15a501b81354db505daf50703a1a0 Mon Sep 17 00:00:00 2001 From: Kinsey Moore Date: Thu, 10 May 2012 20:56:09 +0000 Subject: Resolve FORWARD_NULL static analysis warnings This resolves core findings from ASTERISK-19650 numbers 0-2, 6, 7, 9-11, 14-20, 22-24, 28, 30-32, 34-36, 42-56, 82-84, 87, 89-90, 93-102, 104, 105, 109-111, and 115. Finding numbers 26, 33, and 29 were already resolved. Those skipped were either extended/deprecated or in areas of code that shouldn't be disturbed. (Closes issue ASTERISK-19650) ........ Merged revisions 366167 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366168 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366169 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/app.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'main/app.c') diff --git a/main/app.c b/main/app.c index c37279658..3d2fa52c3 100644 --- a/main/app.c +++ b/main/app.c @@ -721,6 +721,9 @@ int ast_control_streamfile(struct ast_channel *chan, const char *file, long pause_restart_point = 0; long offset = 0; + if (!file) { + return -1; + } if (offsetms) { offset = *offsetms * 8; /* XXX Assumes 8kHz */ } @@ -752,12 +755,10 @@ int ast_control_streamfile(struct ast_channel *chan, const char *file, res = ast_answer(chan); } - if (file) { - if ((end = strchr(file, ':'))) { - if (!strcasecmp(end, ":end")) { - *end = '\0'; - end++; - } + if ((end = strchr(file, ':'))) { + if (!strcasecmp(end, ":end")) { + *end = '\0'; + end++; } } -- cgit v1.2.3