mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
mesa: Fix memory leak in _mesa_get_uniform_location.
Fixes Coverity resource leak defect.
NOTE: This is a candidate for the 8.0 branch.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 0f3aa9f4bd)
This commit is contained in:
parent
97bff96352
commit
b304eca8df
1 changed files with 3 additions and 1 deletions
|
|
@ -905,8 +905,10 @@ _mesa_get_uniform_location(struct gl_context *ctx,
|
|||
name_copy[i-1] = '\0';
|
||||
|
||||
offset = strtol(&name[i], NULL, 10);
|
||||
if (offset < 0)
|
||||
if (offset < 0) {
|
||||
free(name_copy);
|
||||
return -1;
|
||||
}
|
||||
|
||||
array_lookup = true;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue