mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-07-22 19:24:27 +00:00
shared/cairo-util: Zero out the memory when creating a new theme
Having the memory zeroed out just works better and avoids any possible illegal access. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
parent
f8a9ce3f55
commit
60b307e3ce
|
@ -37,6 +37,7 @@
|
|||
|
||||
#include "shared/helpers.h"
|
||||
#include "image-loader.h"
|
||||
#include "shared/xalloc.h"
|
||||
#include <libweston/config-parser.h>
|
||||
|
||||
#ifdef HAVE_PANGO
|
||||
|
@ -419,9 +420,7 @@ theme_create(void)
|
|||
struct theme *t;
|
||||
cairo_t *cr;
|
||||
|
||||
t = malloc(sizeof *t);
|
||||
if (t == NULL)
|
||||
return NULL;
|
||||
t = xzalloc(sizeof *t);
|
||||
|
||||
t->margin = 32;
|
||||
t->width = 6;
|
||||
|
|
Loading…
Reference in a new issue