Use [x]zalloc instead of [x]malloc + memset
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
diff --git a/clients/editor.c b/clients/editor.c
index d0b7fee..7d388a4 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -687,8 +687,7 @@
{
struct text_entry *entry;
- entry = xmalloc(sizeof *entry);
- memset(entry, 0, sizeof *entry);
+ entry = xzalloc(sizeof *entry);
entry->widget = widget_add_widget(editor->widget, entry);
entry->window = editor->window;
diff --git a/clients/subsurfaces.c b/clients/subsurfaces.c
index 32179db..b971fdf 100644
--- a/clients/subsurfaces.c
+++ b/clients/subsurfaces.c
@@ -498,8 +498,7 @@
{
struct triangle *tri;
- tri = xmalloc(sizeof *tri);
- memset(tri, 0, sizeof *tri);
+ tri = xzalloc(sizeof *tri);
tri->egl = egl;
tri->widget = window_add_subsurface(window, tri,
@@ -720,8 +719,7 @@
{
struct demoapp *app;
- app = xmalloc(sizeof *app);
- memset(app, 0, sizeof *app);
+ app = xzalloc(sizeof *app);
app->egl = egl_state_create(display_get_display(display));