Browse Source

Added allocation failure check.

Camilla Berglund 13 years ago
parent
commit
c87829ea61
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/win32_monitor.c

+ 5 - 0
src/win32_monitor.c

@@ -124,6 +124,11 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
                     size = 4;
 
                 monitors = (_GLFWmonitor**) realloc(monitors, sizeof(_GLFWmonitor*) * size);
+                if (!monitors)
+                {
+                    // TODO: wat
+                    return NULL;
+                }
             }
 
             monitors[found] = _glfwCreateMonitor(name,