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

Closes #898
This commit is contained in:
correctmost 2025-05-26 21:12:29 -04:00
parent 2e2080247f
commit a1c31f5ed5

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