initialise display

fixes valgrind:
==25178== Conditional jump or move depends on uninitialised value(s)
==25178==    at 0x409E2C: display_create (window.c:1582)
==25178==    by 0x407A43: main (terminal.c:2323)
and
==13793== Conditional jump or move depends on uninitialised value(s)
==13793==    at 0x40A2D1: display_handle_global (window.c:1504)
==13793==    by 0x4E2C183: display_handle_global (wayland-client.c:281)
==13793==    by 0x713FEE7: ffi_call_unix64 (in /usr/lib/libffi.so.5.0.10)
==13793==    by 0x713FC83: ffi_call (in /usr/lib/libffi.so.5.0.10)
==13793==    by 0x4E2C71A: wl_closure_invoke (connection.c:663)
==13793==    by 0x4E2BB7B: wl_display_iterate (wayland-client.c:484)
==13793==    by 0x4096CA: display_create (window.c:1664)
==13793==    by 0x407A43: main (terminal.c:2321)
dev
Tim Wiederhake 14 years ago committed by Kristian Høgsberg
parent 748f672b2c
commit 81bd979835
  1. 2
      clients/window.c

@ -1647,6 +1647,8 @@ display_create(int *argc, char **argv[], const GOptionEntry *option_entries)
if (d == NULL)
return NULL;
memset(d, 0, sizeof *d);
d->display = wl_display_connect(NULL);
if (d->display == NULL) {
fprintf(stderr, "failed to create display: %m\n");

Loading…
Cancel
Save