mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 12:30:09 +01: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>
This commit is contained in:
parent
318669f196
commit
0f3aa9f4bd
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