From: Juha-Pekka Heikkila Date: Wed, 2 Jul 2014 17:50:42 +0000 (+0300) Subject: mesa/main: Check allocations success in _mesa_one_time_init_extension_overrides() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=51aa22148099f3c7e7e63b77523af629a535fa43;p=mesa.git mesa/main: Check allocations success in _mesa_one_time_init_extension_overrides() Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Anuj Phogat --- 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;