Module: Mesa
Branch: staging/23.3
Commit: 8d9fa8ef99ae2699a9a365d71f281865ae717e84
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8d9fa8ef99ae2699a9a365d71f281865ae717e84

Author: Paulo Zanoni <paulo.r.zan...@intel.com>
Date:   Fri Sep  8 15:10:33 2023 -0700

vulkan: fix potential memory leak in create_rect_list_pipeline()

I was playing around with possible improvements to STACK_ARRAY(), and
one of my experiments made gcc point us that we were not freeing
'stages'.

Fixes: 514c10344e6f ("vulkan/meta: Add a concept of rect pipelines")
Reviewed-by: Karmjit Mahil <karmjit.ma...@imgtec.com>
Reviewed-by: Faith Ekstrand <faith.ekstr...@collabora.com>
Signed-off-by: Paulo Zanoni <paulo.r.zan...@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26041>
(cherry picked from commit 17e135d3d4a4bb1d835aba6ffdf1997e23360843)

---

 .pick_status.json            | 2 +-
 src/vulkan/runtime/vk_meta.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 97780ecf826..164c39fe3e9 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -154,7 +154,7 @@
         "description": "vulkan: fix potential memory leak in 
create_rect_list_pipeline()",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "514c10344e6f2e99776c4bcc907d500f0837dc2b",
         "notes": null
diff --git a/src/vulkan/runtime/vk_meta.c b/src/vulkan/runtime/vk_meta.c
index 1ea4dc77b0e..f1570908fb9 100644
--- a/src/vulkan/runtime/vk_meta.c
+++ b/src/vulkan/runtime/vk_meta.c
@@ -398,6 +398,7 @@ create_rect_list_pipeline(struct vk_device *device,
                                                    pipeline_out);
 
    STACK_ARRAY_FINISH(dyn_state);
+   STACK_ARRAY_FINISH(stages);
 
    return result;
 }

Reply via email to