diff options
author | Brian Lovin <brian.j.lovin@intel.com> | 2013-08-07 15:34:59 -0700 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-08-07 16:27:33 -0700 |
commit | bc91926e0cf2abe875c404b111dd08ad507d91a1 (patch) | |
tree | 1daee7d5ce38da5bcd9d11cd95af9c4e9292e63c /clients/subsurfaces.c | |
parent | 1c4f163c6d74c8aab69d2dbb9a03dc0e0e80f374 (diff) | |
download | weston-bc91926e0cf2abe875c404b111dd08ad507d91a1.tar.gz |
clients: use xmalloc in more places
For the clients continue to use xmalloc() to simplify OOM-handling.
Signed-off-by: Brian Lovin <brian.j.lovin@intel.com>
Diffstat (limited to 'clients/subsurfaces.c')
-rw-r--r-- | clients/subsurfaces.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clients/subsurfaces.c b/clients/subsurfaces.c index 7fa8abbc..f93057e7 100644 --- a/clients/subsurfaces.c +++ b/clients/subsurfaces.c @@ -489,7 +489,8 @@ triangle_create(struct window *window, struct egl_state *egl) { struct triangle *tri; - tri = calloc(1, sizeof *tri); + tri = xmalloc(sizeof *tri); + memset(tri, 0, sizeof *tri); tri->egl = egl; tri->widget = window_add_subsurface(window, tri, @@ -709,9 +710,8 @@ demoapp_create(struct display *display) { struct demoapp *app; - app = calloc(1, sizeof *app); - if (!app) - return NULL; + app = xmalloc(sizeof *app); + memset(app, 0, sizeof *app); app->egl = egl_state_create(display_get_display(display)); |