[Mesa-dev] [PATCH] radv: fix a memleak when compiling the GS copy shader

Samuel Pitoiset samuel.pitoiset at gmail.com
Fri Sep 1 12:07:43 UTC 2017


Found by inspection.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/amd/vulkan/radv_pipeline.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index f2d1b491b7..858cc54085 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -618,6 +618,9 @@ radv_pipeline_compile(struct radv_pipeline *pipeline,
 								  gs_copy_code,
 								  gs_copy_code_size);
 		}
+
+		if (gs_copy_code)
+			free(gs_copy_code);
 	}
 	if (!module->nir)
 		ralloc_free(nir);
-- 
2.14.1



More information about the mesa-dev mailing list