[PATCH 1/7] pixman-renderer: Initialize pixman-renderer struct with zeros

Ander Conselvan de Oliveira ander.conselvan.de.oliveira at intel.com
Fri Oct 25 15:26:31 CEST 2013


Othrewise a crash may happen because of an unitialized value of the
create_view field.
---
 src/pixman-renderer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pixman-renderer.c b/src/pixman-renderer.c
index 85fcd4c..d6f638d 100644
--- a/src/pixman-renderer.c
+++ b/src/pixman-renderer.c
@@ -660,7 +660,7 @@ pixman_renderer_init(struct weston_compositor *ec)
 {
 	struct pixman_renderer *renderer;
 
-	renderer = malloc(sizeof *renderer);
+	renderer = calloc(1, sizeof *renderer);
 	if (renderer == NULL)
 		return -1;
 
-- 
1.7.9.5



More information about the wayland-devel mailing list