summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/uniform_query.cpp4
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 {