mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 20:28:02 +02:00
src: Fix memory issue reported by cppcheck static analysis tool
cppcheck analysis tool reports the following issues when run on the latest Cairo source. $ grep "(error)" cppcheck_error_log.txt [src/skia/cairo-skia-surface.cpp:245]: (error) Memory leak: surface $ The proposed changes fixes the above issues. Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
a5f51588af
commit
52c4f0f2da
1 changed files with 3 additions and 1 deletions
|
|
@ -241,8 +241,10 @@ _cairo_skia_surface_create_internal (SkBitmap::Config config,
|
|||
pixman_image = pixman_image_create_bits (pixman_format,
|
||||
width, height,
|
||||
(uint32_t *) data, stride);
|
||||
if (unlikely (pixman_image == NULL))
|
||||
if (unlikely (pixman_image == NULL)) {
|
||||
free (surface);
|
||||
return (cairo_skia_surface_t *) _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
|
||||
}
|
||||
|
||||
_cairo_surface_init (&surface->image.base,
|
||||
&cairo_skia_surface_backend,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue