mesa/main: Check allocations success in _mesa_one_time_init_extension_overrides()
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Wed, 2 Jul 2014 17:50:42 +0000 (20:50 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Tue, 23 Sep 2014 07:25:02 +0000 (10:25 +0300)
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/main/extensions.c

index 553c01e343beacff0c0cc96731847f824f8febda..43f0e8dd0cc99c8a86f676bdca3e82bb8db567cb 100644 (file)
@@ -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;