mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
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
This commit is contained in:
@@ -562,7 +562,11 @@ struct ast_variable *ast_variable_browse(const struct ast_config *config, const
|
||||
{
|
||||
struct ast_category *cat = NULL;
|
||||
|
||||
if (category && config->last_browse && (config->last_browse->name == category)) {
|
||||
if (!category) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (config->last_browse && (config->last_browse->name == category)) {
|
||||
cat = config->last_browse;
|
||||
} else {
|
||||
cat = ast_category_get(config, category);
|
||||
@@ -1898,7 +1902,7 @@ int ast_config_text_file_save(const char *configfile, const struct ast_config *c
|
||||
/* Dump section with any appropriate comment */
|
||||
for (cmt = cat->precomments; cmt; cmt=cmt->next) {
|
||||
char *cmtp = cmt->cmt;
|
||||
while (*cmtp == ';' && *(cmtp+1) == '!') {
|
||||
while (cmtp && *cmtp == ';' && *(cmtp+1) == '!') {
|
||||
char *cmtp2 = strchr(cmtp+1, '\n');
|
||||
if (cmtp2)
|
||||
cmtp = cmtp2+1;
|
||||
|
Reference in New Issue
Block a user