d3d12: Fix memory leak if state is NULL.
Fix defect reported by Coverity Scan.
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable ss going out of scope leaks the storage it points to.
Fixes: 2ea15cd661
("d3d12: introduce d3d12 gallium driver")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8179>
This commit is contained in:
parent
671e1571d9
commit
28a9c9e573
|
@ -619,11 +619,12 @@ d3d12_create_sampler_state(struct pipe_context *pctx,
|
|||
{
|
||||
struct d3d12_context *ctx = d3d12_context(pctx);
|
||||
struct d3d12_screen *screen = d3d12_screen(pctx->screen);
|
||||
struct d3d12_sampler_state *ss = CALLOC_STRUCT(d3d12_sampler_state);
|
||||
struct d3d12_sampler_state *ss;
|
||||
D3D12_SAMPLER_DESC desc = {};
|
||||
if (!state)
|
||||
return NULL;
|
||||
|
||||
ss = CALLOC_STRUCT(d3d12_sampler_state);
|
||||
ss->filter = (pipe_tex_filter)state->min_img_filter;
|
||||
ss->wrap_r = (pipe_tex_wrap)state->wrap_r;
|
||||
ss->wrap_s = (pipe_tex_wrap)state->wrap_s;
|
||||
|
|
Loading…
Reference in New Issue