clients/simple-damage,simple-shm: Use calloc instead of malloc
This avoids some unwarranted errors about conditional jumps or invalid access from ASan as malloc doesn't set the memory to zero. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
parent
f676a8f54e
commit
6eabd93d59
|
@ -774,7 +774,7 @@ create_display(int version)
|
|||
{
|
||||
struct display *display;
|
||||
|
||||
display = malloc(sizeof *display);
|
||||
display = zalloc(sizeof *display);
|
||||
if (display == NULL) {
|
||||
fprintf(stderr, "out of memory\n");
|
||||
exit(1);
|
||||
|
|
|
@ -396,7 +396,7 @@ create_display(void)
|
|||
{
|
||||
struct display *display;
|
||||
|
||||
display = malloc(sizeof *display);
|
||||
display = zalloc(sizeof *display);
|
||||
if (display == NULL) {
|
||||
fprintf(stderr, "out of memory\n");
|
||||
exit(1);
|
||||
|
|
Loading…
Reference in New Issue