asahi: Fix memory leak on error path.
authorVinson Lee <vlee@freedesktop.org>
Sun, 20 Nov 2022 21:41:55 +0000 (13:41 -0800)
committerVinson Lee <vlee@freedesktop.org>
Sun, 20 Nov 2022 21:41:55 +0000 (13:41 -0800)
commite8ff841e983c4b45ff0449796fc17d73a8ca599c
tree08ddd02da72de79b572609d1e1e9646e434c2613
parent0803e39b7190eed90402565477329a1be7479b9b
asahi: Fix memory leak on error path.

Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable rsc going out of scope leaks the storage it points to.

Fixes: 01964625eb2 ("asahi: Implement agx_resource_from_handle")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19887>
src/gallium/drivers/asahi/agx_pipe.c