mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Don't leak if arguments appear multiple times, from Tiago Cunha.
This commit is contained in:
		@@ -79,7 +79,8 @@ cmd_bind_key_parse(struct cmd *self, int argc, char **argv, char **cause)
 | 
				
			|||||||
			data->can_repeat = 1;
 | 
								data->can_repeat = 1;
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case 't':
 | 
							case 't':
 | 
				
			||||||
			data->tablename = xstrdup(optarg);
 | 
								if (data->tablename == NULL)
 | 
				
			||||||
 | 
									data->tablename = xstrdup(optarg);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		default:
 | 
							default:
 | 
				
			||||||
			goto usage;
 | 
								goto usage;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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) {
 | 
						while ((opt = getopt(argc, argv, "c:t:")) != -1) {
 | 
				
			||||||
		switch (opt) {
 | 
							switch (opt) {
 | 
				
			||||||
		case 'c':
 | 
							case 'c':
 | 
				
			||||||
			data->name = xstrdup(optarg);
 | 
								if (data->name == NULL)
 | 
				
			||||||
 | 
									data->name = xstrdup(optarg);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case 't':
 | 
							case 't':
 | 
				
			||||||
			data->target = xstrdup(optarg);
 | 
								if (data->target == NULL)
 | 
				
			||||||
 | 
									data->target = xstrdup(optarg);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		default:
 | 
							default:
 | 
				
			||||||
			goto usage;
 | 
								goto usage;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -67,7 +67,8 @@ cmd_unbind_key_parse(struct cmd *self, int argc, char **argv, char **cause)
 | 
				
			|||||||
			no_prefix = 1;
 | 
								no_prefix = 1;
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case 't':
 | 
							case 't':
 | 
				
			||||||
			data->tablename = xstrdup(optarg);
 | 
								if (data->tablename == NULL)
 | 
				
			||||||
 | 
									data->tablename = xstrdup(optarg);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		default:
 | 
							default:
 | 
				
			||||||
			goto usage;
 | 
								goto usage;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user