mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 12:40:23 +01:00
freedreno/a6xx: Fix memory leak on error path.
Fix defect reported by Coverity Scan.
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable fd6_ctx going out of scope leaks the storage it points to.
Fixes: de3b34df97 ("freedreno: Add a6xx backend")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23289>
This commit is contained in:
parent
5293a99ad1
commit
7637fba452
1 changed files with 3 additions and 1 deletions
|
|
@ -264,8 +264,10 @@ fd6_context_create(struct pipe_screen *pscreen, void *priv,
|
|||
setup_state_map(&fd6_ctx->base);
|
||||
|
||||
pctx = fd_context_init(&fd6_ctx->base, pscreen, priv, flags);
|
||||
if (!pctx)
|
||||
if (!pctx) {
|
||||
free(fd6_ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pctx->set_framebuffer_state = fd6_set_framebuffer_state;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue