mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 10:47:18 +00:00 
			
		
		
		
	Fix minor memory leak from tab completion (bug #2059)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -1131,11 +1131,15 @@ static int ast_cli_display_match_list(char **matches, int len, int max) | ||||
| 			/* Don't print dupes */ | ||||
| 			if ( (matches[idx+1] != NULL && strcmp(matches[idx], matches[idx+1]) == 0 ) ) { | ||||
| 				i--; | ||||
| 				free(matches[idx]); | ||||
| 				matches[idx] = NULL; | ||||
| 				continue; | ||||
| 			} | ||||
|  | ||||
| 			numoutput++;  numoutputline++; | ||||
| 			fprintf(stdout, "%-*s  ", max, matches[idx]); | ||||
| 			free(matches[idx]); | ||||
| 			matches[idx] = NULL; | ||||
| 		} | ||||
| 		if (numoutputline > 0) | ||||
| 			fprintf(stdout, "\n"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user