From 81bd979835fbf035f2d46907a4a68ebcd5361a7c Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Sun, 23 Jan 2011 23:25:26 +0100 Subject: [PATCH] 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) --- clients/window.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clients/window.c b/clients/window.c index 2944287..59ea975 100644 --- a/clients/window.c +++ b/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"); -- 2.7.4