Merge branch 'cm/fix-uaf-warning' into 'master'

xcb: Fix a -Wuse-after-free=3 warning with GCC

Closes #898

See merge request cairo/cairo!623
This commit is contained in:
Uli Schlachter 2025-05-27 16:02:14 +00:00
commit a3ca983ec3

View file

@ -93,13 +93,13 @@ _cairo_xcb_connection_shm_get_image (cairo_xcb_connection_t *connection,
XCB_IMAGE_FORMAT_Z_PIXMAP,
shmseg, offset),
NULL);
free (reply);
if (!reply) {
/* an error here should be impossible */
return _cairo_error (CAIRO_STATUS_READ_ERROR);
}
free (reply);
return CAIRO_STATUS_SUCCESS;
}