eventdemo: use zalloc
Zero-initialize the struct, just in case. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Tested-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Benoit Gschwind <gschwind@gnu-log.net> Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
This commit is contained in:
+1
-1
@@ -373,7 +373,7 @@ eventdemo_create(struct display *d)
|
|||||||
{
|
{
|
||||||
struct eventdemo *e;
|
struct eventdemo *e;
|
||||||
|
|
||||||
e = malloc(sizeof (struct eventdemo));
|
e = zalloc(sizeof (struct eventdemo));
|
||||||
if (e == NULL)
|
if (e == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user