diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index 60d014c21..75bc9646a 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -77,10 +77,12 @@ check_modesetting(int devindex) if (conn->connection == DRM_MODE_CONNECTED && conn->count_modes) { available = SDL_TRUE; - break; } KMSDRM_drmModeFreeConnector(conn); + if (available) { + break; + } } } KMSDRM_drmModeFreeResources(resources);