mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 14:08:05 +02:00
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: 01964625eb ("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>
This commit is contained in:
parent
0803e39b71
commit
e8ff841e98
1 changed files with 3 additions and 1 deletions
|
|
@ -174,8 +174,10 @@ agx_resource_from_handle(struct pipe_screen *pscreen,
|
|||
/* We need strides to be aligned. ail asserts this, but we want to fail
|
||||
* gracefully so the app can handle the error.
|
||||
*/
|
||||
if (rsc->modifier == DRM_FORMAT_MOD_LINEAR && (whandle->stride % 16) != 0)
|
||||
if (rsc->modifier == DRM_FORMAT_MOD_LINEAR && (whandle->stride % 16) != 0) {
|
||||
FREE(rsc);
|
||||
return false;
|
||||
}
|
||||
|
||||
prsc = &rsc->base;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue