xwayland/shm: Use `calloc()`
Currently, Xwayland pixmap SHM code uses `malloc()` to allocate the xwl_pixmap. Use `calloc()` instead, as the EGLstream backend does, as it is safer (initializing the allocated data to 0). Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
This commit is contained in:
		
							parent
							
								
									0d4667b65a
								
							
						
					
					
						commit
						4a857b161c
					
				|  | @ -210,7 +210,7 @@ xwl_shm_create_pixmap(ScreenPtr screen, | |||
|     if (!pixmap) | ||||
|         return NULL; | ||||
| 
 | ||||
|     xwl_pixmap = malloc(sizeof *xwl_pixmap); | ||||
|     xwl_pixmap = calloc(1, sizeof(*xwl_pixmap)); | ||||
|     if (xwl_pixmap == NULL) | ||||
|         goto err_destroy_pixmap; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue