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:
Marius Vlad 2022-07-12 14:31:07 +03:00
parent f8a9ce3f55
commit 60b307e3ce

View file

@ -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;