Loader: Fix Seg fault when layers not activated via env var
authorJon Ashburn <jon@lunarg.com>
Thu, 23 Oct 2014 16:29:09 +0000 (10:29 -0600)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Thu, 30 Oct 2014 00:02:02 +0000 (18:02 -0600)
loader/loader.c

index 7dea427..8b0cd67 100644 (file)
@@ -629,6 +629,8 @@ static XGL_UINT loader_get_layer_env(XGL_CHAR * *ppLayerNames)
     char *p, *pOrig, *next, *name;
 
     layerEnv = getenv("LIBXGL_LAYER_LIBS");
+    if (!layerEnv)
+        return 0;
     p = malloc(strlen(layerEnv) + 1);
     if (!p)
         return 0;