[PATCH weston 2/3] eventdemo: use zalloc

Benoit Gschwind gschwind at gnu-log.net
Fri May 13 09:03:22 UTC 2016


Hello Pekka,

Reviewed-by: Benoit Gschwind <gschwind at gnu-log.net>
Tested-by: Benoit Gschwind <gschwind at gnu-log.net>

just in case, If you apply my suggestion for the previous patch, this
patch may be useless.

Best regards,
Benoit Gschwind

On 10/05/2016 16:11, Pekka Paalanen wrote:
> From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> 
> Zero-initialize the struct, just in case.
> 
> Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> ---
>  clients/eventdemo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/clients/eventdemo.c b/clients/eventdemo.c
> index f1558d2..38eb904 100644
> --- a/clients/eventdemo.c
> +++ b/clients/eventdemo.c
> @@ -373,7 +373,7 @@ eventdemo_create(struct display *d)
>  {
>  	struct eventdemo *e;
>  
> -	e = malloc(sizeof (struct eventdemo));
> +	e = zalloc(sizeof (struct eventdemo));
>  	if (e == NULL)
>  		return NULL;
>  
> 


More information about the wayland-devel mailing list