mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	Fix potential memory leak
This commit is contained in:
		
							parent
							
								
									9e345f0f98
								
							
						
					
					
						commit
						50d91bd260
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -232,8 +232,12 @@ static void handle_offer_source_destroyed(struct wl_listener *listener,
 | 
				
			||||||
static struct wlr_data_offer *wlr_data_source_send_offer(
 | 
					static struct wlr_data_offer *wlr_data_source_send_offer(
 | 
				
			||||||
		struct wlr_data_source *source,
 | 
							struct wlr_data_source *source,
 | 
				
			||||||
		struct wlr_seat_client *target) {
 | 
							struct wlr_seat_client *target) {
 | 
				
			||||||
 | 
						if (wl_list_empty(&target->data_devices)) {
 | 
				
			||||||
 | 
							return NULL;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct wlr_data_offer *offer = calloc(1, sizeof(struct wlr_data_offer));
 | 
						struct wlr_data_offer *offer = calloc(1, sizeof(struct wlr_data_offer));
 | 
				
			||||||
	if (offer == NULL || wl_list_empty(&target->data_devices)) {
 | 
						if (offer == NULL) {
 | 
				
			||||||
		return NULL;
 | 
							return NULL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue