mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
radeonsi: Fix resource leak in gs_copy_shader allocation failure path
CID 1394028 Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com> Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
0e11290ef5
commit
9c5b1c7990
1 changed files with 8 additions and 2 deletions
|
|
@ -6137,10 +6137,16 @@ si_generate_gs_copy_shader(struct si_screen *sscreen,
|
|||
|
||||
outputs = MALLOC(gsinfo->num_outputs * sizeof(outputs[0]));
|
||||
|
||||
shader = CALLOC_STRUCT(si_shader);
|
||||
if (!shader)
|
||||
if (!outputs)
|
||||
return NULL;
|
||||
|
||||
shader = CALLOC_STRUCT(si_shader);
|
||||
if (!shader) {
|
||||
FREE(outputs);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
shader->selector = gs_selector;
|
||||
shader->is_gs_copy_shader = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue