From c87829ea6184da351430eec2ceb21986bc42c403 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 12 Sep 2012 20:54:45 +0200 Subject: [PATCH] Added allocation failure check. --- src/win32_monitor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/win32_monitor.c b/src/win32_monitor.c index fe2ae7a1..527e4e6f 100644 --- a/src/win32_monitor.c +++ b/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,