瀏覽代碼

Fix memory leak in WIN_GetMonitorPathInfo

Mathieu Eyraud 1 年之前
父節點
當前提交
29d43272e2
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/video/windows/SDL_windowsmodes.c

+ 2 - 0
src/video/windows/SDL_windowsmodes.c

@@ -407,6 +407,8 @@ static SDL_bool WIN_GetMonitorPathInfo(HMONITOR hMonitor, DISPLAYCONFIG_PATH_INF
 
 
     do {
     do {
         if (GetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &num_path_array_elements, &num_mode_info_array_elements) != ERROR_SUCCESS) {
         if (GetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &num_path_array_elements, &num_mode_info_array_elements) != ERROR_SUCCESS) {
+            SDL_free(path_infos);
+            SDL_free(mode_infos);
             return SDL_FALSE;
             return SDL_FALSE;
         }
         }