mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-04-27 15:20:51 +02: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:
parent
0d4667b65a
commit
4a857b161c
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Reference in a new issue