etnaviv: Fix memory leak in etna_vertex_elements_state_create.
Fix defect reported by Coverity Scan.
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable cs going out of scope leaks the storage it points to.
Fixes: c9e8b49b88 ("etnaviv: gallium driver for Vivante GPUs")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9034>
This commit is contained in:
@@ -521,6 +521,7 @@ etna_vertex_elements_state_create(struct pipe_context *pctx,
|
||||
if (num_elements > screen->specs.vertex_max_elements) {
|
||||
BUG("number of elements (%u) exceeds chip maximum (%u)", num_elements,
|
||||
screen->specs.vertex_max_elements);
|
||||
FREE(cs);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user