소스 검색

Fix potential leak in camera example

Petar Popovic 2 주 전
부모
커밋
eacfe835e7
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;
     } else if (devcount == 0) {
         SDL_Log("Couldn't find any camera devices! Please connect a camera and try again.");
+        SDL_free(devices);
         return SDL_APP_FAILURE;
     }