mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
zink: handle calloc-failure
In case we fail to allocate the context, we should notice and fail gracefully. CoverityID: 1455193 Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
8772d95d40
commit
8e1dca35ab
1 changed files with 2 additions and 0 deletions
|
|
@ -1041,6 +1041,8 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
|
|||
{
|
||||
struct zink_screen *screen = zink_screen(pscreen);
|
||||
struct zink_context *ctx = CALLOC_STRUCT(zink_context);
|
||||
if (!ctx)
|
||||
goto fail;
|
||||
|
||||
ctx->base.screen = pscreen;
|
||||
ctx->base.priv = priv;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue