[Mesa-dev] [PATCH] radeonsi: Fix resource leak in gs_copy_shader allocation failure path
Mun Gwan-gyeong
elongbug at gmail.com
Sun Nov 20 04:19:57 UTC 2016
CID 1394028
Signed-off-by: Mun Gwan-gyeong <elongbug at gmail.com>
---
src/gallium/drivers/radeonsi/si_shader.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 917e148..608cb72 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -6137,9 +6137,15 @@ si_generate_gs_copy_shader(struct si_screen *sscreen,
outputs = MALLOC(gsinfo->num_outputs * sizeof(outputs[0]));
+ if (!outputs)
+ return NULL;
+
shader = CALLOC_STRUCT(si_shader);
- if (!shader)
+ if (!shader) {
+ FREE(outputs);
return NULL;
+ }
+
shader->selector = gs_selector;
shader->is_gs_copy_shader = true;
--
2.10.2
More information about the mesa-dev
mailing list