mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 18:55:19 +00:00 
			
		
		
		
	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:
		
				
					committed by
					
						 George Joseph
						George Joseph
					
				
			
			
				
	
			
			
			
						parent
						
							990a91b44a
						
					
				
				
					commit
					bdd785d31c
				
			| @@ -156,7 +156,7 @@ static struct ast_config *realtime_multi_curl(const char *url, const char *unuse | ||||
| 	for (field = fields; field; field = field->next) { | ||||
| 		if (start) { | ||||
| 			char *op; | ||||
| 			initfield = ast_strdupa(field->name); | ||||
| 			initfield = ast_strdup(field->name); | ||||
| 			if ((op = strchr(initfield, ' '))) | ||||
| 				*op = '\0'; | ||||
| 		} | ||||
| @@ -172,6 +172,7 @@ static struct ast_config *realtime_multi_curl(const char *url, const char *unuse | ||||
| 	ast_str_substitute_variables(&buffer, 0, NULL, ast_str_buffer(query)); | ||||
|  | ||||
| 	if (!(cfg = ast_config_new())) { | ||||
| 		ast_free(initfield); | ||||
| 		return NULL; | ||||
| 	} | ||||
|  | ||||
| @@ -206,6 +207,8 @@ static struct ast_config *realtime_multi_curl(const char *url, const char *unuse | ||||
| 		ast_category_append(cfg, cat); | ||||
| 	} | ||||
|  | ||||
| 	ast_free(initfield); | ||||
|  | ||||
| 	return cfg; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user