diff options
author | Vinson Lee <[email protected]> | 2012-03-22 23:59:52 -0700 |
---|---|---|
committer | Vinson Lee <[email protected]> | 2012-03-23 22:52:57 -0700 |
commit | 0f3aa9f4bd7daab354deb9268307c5628b460f6b (patch) | |
tree | d0f98b2c9987925a30a4691fb8006f4497e9080f /src | |
parent | 318669f196ca922337da02af9d72773e76e70b45 (diff) |
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 <[email protected]>
Reviewed-by: José Fonseca <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/uniform_query.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index 991df7896b4..da41ee84c9c 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -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 { |