mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	wlr_output: fix scope for 'now'
'when' points to now that was defined in the if, so compiler could reuse that memory area by the time 'when' is called Found through static analysis.
This commit is contained in:
		
							parent
							
								
									399de4d11b
								
							
						
					
					
						commit
						b3313b7f39
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -486,8 +486,8 @@ bool wlr_output_swap_buffers(struct wlr_output *output, struct timespec *when,
 | 
				
			||||||
		pixman_region32_intersect(&render_damage, &render_damage, damage);
 | 
							pixman_region32_intersect(&render_damage, &render_damage, damage);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (when == NULL) {
 | 
					 | 
				
			||||||
	struct timespec now;
 | 
						struct timespec now;
 | 
				
			||||||
 | 
						if (when == NULL) {
 | 
				
			||||||
		clock_gettime(CLOCK_MONOTONIC, &now);
 | 
							clock_gettime(CLOCK_MONOTONIC, &now);
 | 
				
			||||||
		when = &now;
 | 
							when = &now;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue