Преглед изворни кода

Fix potential leak in camera example

(cherry picked from commit eacfe835e7c1bf8e59e91f788a86227510852b34)
Petar Popovic пре 3 месеци
родитељ
комит
7bd84b29e9
1 измењених фајлова са 1 додато и 0 уклоњено
  1. 1 0
      examples/camera/01-read-and-draw/read-and-draw.c

+ 1 - 0
examples/camera/01-read-and-draw/read-and-draw.c

@@ -44,6 +44,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
         return SDL_APP_FAILURE;
         return SDL_APP_FAILURE;
     } else if (devcount == 0) {
     } else if (devcount == 0) {
         SDL_Log("Couldn't find any camera devices! Please connect a camera and try again.");
         SDL_Log("Couldn't find any camera devices! Please connect a camera and try again.");
+        SDL_free(devices);
         return SDL_APP_FAILURE;
         return SDL_APP_FAILURE;
     }
     }