mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-03-06 04:40:37 +01:00
xlib: Avoid using uninitialised variable on impossible error path
In commit f6843d5cbb
Author: Arpit Jain <jain.arpit@samsung.com>
Date: Mon Jul 6 14:13:06 2015 -0700
xlib: Fix deferencing of uninitialised 'display'
the common error + clenaup path was clumsily fixed to use the right
variable after the error didn't set the local display variable.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
84b8d76576
commit
dced42a680
1 changed files with 2 additions and 2 deletions
|
|
@ -965,7 +965,7 @@ _cairo_xlib_font_fini (cairo_scaled_font_private_t *abstract_private,
|
|||
cairo_list_del (&priv->link);
|
||||
|
||||
status = _cairo_xlib_display_acquire (priv->device, &display);
|
||||
if (status)
|
||||
if (unlikely (status)) /* this should be impossible but leak just in case */
|
||||
goto BAIL;
|
||||
|
||||
for (i = 0; i < NUM_GLYPHSETS; i++) {
|
||||
|
|
@ -978,7 +978,7 @@ _cairo_xlib_font_fini (cairo_scaled_font_private_t *abstract_private,
|
|||
|
||||
cairo_device_release (&display->base);
|
||||
BAIL:
|
||||
cairo_device_destroy (&display->base);
|
||||
cairo_device_destroy (priv->device);
|
||||
free (priv);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue