mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Don't leak if arguments appear multiple times, from Tiago Cunha.
This commit is contained in:
		| @@ -61,10 +61,12 @@ cmd_switch_client_parse(struct cmd *self, int argc, char **argv, char **cause) | ||||
| 	while ((opt = getopt(argc, argv, "c:t:")) != -1) { | ||||
| 		switch (opt) { | ||||
| 		case 'c': | ||||
| 			data->name = xstrdup(optarg); | ||||
| 			if (data->name == NULL) | ||||
| 				data->name = xstrdup(optarg); | ||||
| 			break; | ||||
| 		case 't': | ||||
| 			data->target = xstrdup(optarg); | ||||
| 			if (data->target == NULL) | ||||
| 				data->target = xstrdup(optarg); | ||||
| 			break; | ||||
| 		default: | ||||
| 			goto usage; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user