[PATCH] weston: Silence valgrind

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


---
 src/clipboard.c  |    2 ++
 src/compositor.c |    6 +++---
 src/log.c        |    4 ++--
 src/util.c       |    4 ++--
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/clipboard.c b/src/clipboard.c
index 92c8a83..9cf391a 100644
--- a/src/clipboard.c
+++ b/src/clipboard.c
@@ -252,6 +252,8 @@ clipboard_create(struct weston_seat *seat)
 	if (clipboard == NULL)
 		return NULL;
 
+	memset(clipboard, 0, sizeof *clipboard);
+
 	clipboard->seat = seat;
 	clipboard->selection_listener.notify = clipboard_set_selection;
 
diff --git a/src/log.c b/src/log.c
index 0452e65..fb6326c 100644
--- a/src/log.c
+++ b/src/log.c
@@ -94,7 +94,7 @@ WL_EXPORT int
 weston_log(const char *fmt, ...)
 {
 	int l;
-	va_list argp;
+	va_list argp = NULL;
 	va_start(argp, fmt);
 	l = weston_log_timestamp();
 	l += vfprintf(weston_logfile, fmt, argp);
@@ -106,7 +106,7 @@ WL_EXPORT int
 weston_log_continue(const char *fmt, ...)
 {
 	int l;
-	va_list argp;
+	va_list argp = NULL;
 	va_start(argp, fmt);
 	l = vfprintf(weston_logfile, fmt, argp);
 	va_end(argp);
-- 
1.7.5.4



More information about the wayland-devel mailing list