mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Free buffer earlier to avoid confusing some compilers, GitHub issue
2382.
This commit is contained in:
		@@ -2853,6 +2853,7 @@ window_copy_search_jump(struct window_mode_entry *wme, struct grid *gd,
 | 
				
			|||||||
			free(sbuf);
 | 
								free(sbuf);
 | 
				
			||||||
			return (0);
 | 
								return (0);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							free(sbuf);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (direction) {
 | 
						if (direction) {
 | 
				
			||||||
@@ -2889,10 +2890,8 @@ window_copy_search_jump(struct window_mode_entry *wme, struct grid *gd,
 | 
				
			|||||||
			fx = gd->sx - 1;
 | 
								fx = gd->sx - 1;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (regex) {
 | 
						if (regex)
 | 
				
			||||||
		free(sbuf);
 | 
					 | 
				
			||||||
		regfree(®);
 | 
							regfree(®);
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (found) {
 | 
						if (found) {
 | 
				
			||||||
		window_copy_scroll_to(wme, px, i, 1);
 | 
							window_copy_scroll_to(wme, px, i, 1);
 | 
				
			||||||
@@ -3042,6 +3041,7 @@ window_copy_search_marks(struct window_mode_entry *wme, struct screen *ssp,
 | 
				
			|||||||
			free(sbuf);
 | 
								free(sbuf);
 | 
				
			||||||
			return (0);
 | 
								return (0);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							free(sbuf);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	tstart = get_timer();
 | 
						tstart = get_timer();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -3139,10 +3139,8 @@ again:
 | 
				
			|||||||
out:
 | 
					out:
 | 
				
			||||||
	if (ssp == &ss)
 | 
						if (ssp == &ss)
 | 
				
			||||||
		screen_free(&ss);
 | 
							screen_free(&ss);
 | 
				
			||||||
	if (regex) {
 | 
						if (regex)
 | 
				
			||||||
		free(sbuf);
 | 
					 | 
				
			||||||
		regfree(®);
 | 
							regfree(®);
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return (1);
 | 
						return (1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user