# SDL: testautomation\_video: fix memory leak

**URL:** <https://discourse.libsdl.org/t/sdl-testautomation-video-fix-memory-leak/43266>\
**Category:** SDL Commits\
**Created:** [March 24, 2023, 8:54am UTC](https://discourse.libsdl.org/t/sdl-testautomation-video-fix-memory-leak/43266 "2023-03-24T08:54:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [March 24, 2023, 8:54am UTC](https://discourse.libsdl.org/t/sdl-testautomation-video-fix-memory-leak/43266/1 "2023-03-24T08:54:36Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/693558a89402b9ca728fc3dd15c747dc5a66c0b8>

```diff
From 693558a89402b9ca728fc3dd15c747dc5a66c0b8 Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Fri, 24 Mar 2023 09:37:04 +0100
Subject: [PATCH] testautomation_video: fix memory leak

---
 test/testautomation_video.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test/testautomation_video.c b/test/testautomation_video.c
index 776047c1846f..b8fd98f5f4d4 100644
--- a/test/testautomation_video.c
+++ b/test/testautomation_video.c
@@ -313,6 +313,7 @@ static int video_getClosestDisplayModeCurrentResolution(void *arg)
                     SDLTest_AssertCheck(closest->pixel_h == current.pixel_h, "Verify returned height matches current height; expected: %d, got: %d", current.pixel_h, closest->pixel_h);
                 }
             }
+ SDL_free((void *)modes);
         }
         SDL_free(displays);
     }

```
