[Mesa-dev] [PATCH 9/9] mesa/main: Check allocations success in _mesa_one_time_init_extension_overrides()

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Thu Jul 3 01:13:19 PDT 2014


Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 src/mesa/main/extensions.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 92e3f0d..cd89e8f 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -602,6 +602,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;
-- 
1.8.1.2



More information about the mesa-dev mailing list