diff options
author | Bryce Harrington <bryce@osg.samsung.com> | 2018-05-07 17:11:24 -0700 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2021-07-23 18:33:19 +0930 |
commit | c91ae5c5a06d1b0f558f9a83637ba5df99cd2af5 (patch) | |
tree | 7bc7151f3229a93be78e4680e0759f635468466b /boilerplate/cairo-boilerplate-xlib.c | |
parent | ae04679a08f39597907c28c317062b1f22ecf8f8 (diff) | |
download | cairo-c91ae5c5a06d1b0f558f9a83637ba5df99cd2af5.tar.gz |
boilerplate: Use _cairo_malloc instead of malloc
This changes most instances of malloc() calls to use Cairo's safer
_cairo_malloc(). The malloc() call in the implementation of
boilerplate's xmalloc() is not changed since it already includes a
size=0 check.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Diffstat (limited to 'boilerplate/cairo-boilerplate-xlib.c')
-rw-r--r-- | boilerplate/cairo-boilerplate-xlib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/boilerplate/cairo-boilerplate-xlib.c b/boilerplate/cairo-boilerplate-xlib.c index f3d559806..5d2498ccd 100644 --- a/boilerplate/cairo-boilerplate-xlib.c +++ b/boilerplate/cairo-boilerplate-xlib.c @@ -26,6 +26,7 @@ #include "cairo-boilerplate-private.h" #include "cairo-boilerplate-xlib.h" +#include "cairo-malloc-private.h" #include <cairo-xlib.h> #if CAIRO_HAS_XLIB_XRENDER_SURFACE @@ -244,7 +245,7 @@ _cairo_boilerplate_xlib_create_similar (cairo_surface_t *other, struct similar *similar; cairo_surface_t *surface; - similar = malloc (sizeof (*similar)); + similar = _cairo_malloc (sizeof (*similar)); similar->dpy = cairo_xlib_surface_get_display (other); switch (content) { |