various files - fix some alerts raised by lgtm code analysis

This patch fixes several issues reported by the lgtm code analysis tool:

https://lgtm.com/projects/g/asterisk/asterisk

Not all reported issues were addressed in this patch. This patch mostly fixes
confirmed reported errors, potential problematic code points, and a few other
"low hanging" warnings or recommendations found in core supported modules.
These include, but are not limited to the following:

* innapropriate stack allocation in loops
* buffer overflows
* variable declaration "hiding" another variable declaration
* comparisons results that are always the same
* ambiguously signed bit-field members
* missing header guards

Change-Id: Id4a881686605d26c94ab5409bc70fcc21efacc25
This commit is contained in:
Kevin Harwell
2019-10-23 12:36:17 -05:00
committed by George Joseph
parent 990a91b44a
commit bdd785d31c
49 changed files with 324 additions and 203 deletions

View File

@@ -537,13 +537,13 @@ static struct ast_frame *t38_framehook(struct ast_channel *chan, struct ast_fram
if (f->frametype == AST_FRAME_CONTROL
&& f->subclass.integer == AST_CONTROL_T38_PARAMETERS) {
if (channel->session->endpoint->media.t38.enabled) {
struct t38_parameters_task_data *data;
struct t38_parameters_task_data *task_data;
data = t38_parameters_task_data_alloc(channel->session, f);
if (data
task_data = t38_parameters_task_data_alloc(channel->session, f);
if (task_data
&& ast_sip_push_task(channel->session->serializer,
t38_interpret_parameters, data)) {
ao2_ref(data, -1);
t38_interpret_parameters, task_data)) {
ao2_ref(task_data, -1);
}
} else {
static const struct ast_control_t38_parameters rsp_refused = {