diff options
Diffstat (limited to 'mesalib/src/mesa/main/extensions.c')
-rw-r--r-- | mesalib/src/mesa/main/extensions.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c index 553c01e34..f0e2f89e4 100644 --- a/mesalib/src/mesa/main/extensions.c +++ b/mesalib/src/mesa/main/extensions.c @@ -588,7 +588,7 @@ free_unknown_extensions_strings(void) void _mesa_one_time_init_extension_overrides(void) { - const char *env_const = _mesa_getenv("MESA_EXTENSION_OVERRIDE"); + const char *env_const = getenv("MESA_EXTENSION_OVERRIDE"); char *env; char *ext; int len; @@ -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; |