mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-06 21:43:37 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user