modesetting: avoid double free if AddResource fails
ms_dri2_frame_event_client_gone or ms_dri2_frame_event_drawable_gone already free the resource. Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Julien Cristau <jcristau@debian.org>
This commit is contained in:
		
							parent
							
								
									164753f158
								
							
						
					
					
						commit
						acf263df81
					
				|  | @ -97,10 +97,8 @@ ms_get_resource(XID id, RESTYPE type) | ||||||
|     if (resource == NULL) |     if (resource == NULL) | ||||||
|         return NULL; |         return NULL; | ||||||
| 
 | 
 | ||||||
|     if (!AddResource(id, type, resource)) { |     if (!AddResource(id, type, resource)) | ||||||
|         free(resource); |  | ||||||
|         return NULL; |         return NULL; | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     resource->id = id; |     resource->id = id; | ||||||
|     resource->type = type; |     resource->type = type; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue