[PATCH] wayland: Silence valgrind

Martin Minarik minarik11 at student.fiit.stuba.sk
Wed Jun 13 23:48:27 PDT 2012


---
 src/connection.c     |    2 ++
 src/wayland-server.c |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index 1272210..bf75e66 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -422,6 +422,8 @@ wl_closure_vmarshal(struct wl_object *sender,
 	if (closure == NULL)
 		return NULL;
 
+	memset(closure, 0, sizeof *closure + 1024);
+
 	extra_size = wl_message_size_extra(message);
 	count = strlen(message->signature) + 2;
 	extra = (char *) closure->buffer;
diff --git a/src/wayland-server.c b/src/wayland-server.c
index 010d9ca..0baf33a 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -102,9 +102,9 @@ destroy_client(void *data)
 WL_EXPORT void
 wl_resource_post_event(struct wl_resource *resource, uint32_t opcode, ...)
 {
-	struct wl_closure *closure;
+	struct wl_closure *closure = NULL;
 	struct wl_object *object = &resource->object;
-	va_list ap;
+	va_list ap = NULL;
 
 	va_start(ap, opcode);
 	closure = wl_closure_vmarshal(object, opcode, ap,
-- 
1.7.5.4



More information about the wayland-devel mailing list