summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/extensions.c
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <[email protected]>2014-07-02 20:50:42 +0300
committerTapani Pälli <[email protected]>2014-09-23 10:25:02 +0300
commit51aa22148099f3c7e7e63b77523af629a535fa43 (patch)
tree432a170aa1fccce7900731e4eb865c1fe9a86bc9 /src/mesa/main/extensions.c
parenta3d6146e3a772059bfb68d5d041df2b96c4cc444 (diff)
mesa/main: Check allocations success in _mesa_one_time_init_extension_overrides()
Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/mesa/main/extensions.c')
-rw-r--r--src/mesa/main/extensions.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 553c01e343b..43f0e8dd0cc 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -609,6 +609,15 @@ _mesa_one_time_init_extension_overrides(void)
/* Copy env_const because strtok() is destructive. */
env = strdup(env_const);
+
+ if (env == NULL || extra_extensions == NULL ||
+ cant_disable_extensions == NULL) {
+ free(env);
+ free(extra_extensions);
+ free(cant_disable_extensions);
+ return;
+ }
+
for (ext = strtok(env, " "); ext != NULL; ext = strtok(NULL, " ")) {
int enable;
bool recognized;