# SDL: x11: fix memory leak in GetMonitorInfo

**URL:** <https://discourse.libsdl.org/t/sdl-x11-fix-memory-leak-in-getmonitorinfo/69408>\
**Category:** SDL Commits\
**Created:** [September 26, 2026, 8:58pm UTC](https://discourse.libsdl.org/t/sdl-x11-fix-memory-leak-in-getmonitorinfo/69408 "2026-09-26T20:58:38Z")\
**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:** [September 26, 2026, 8:58pm UTC](https://discourse.libsdl.org/t/sdl-x11-fix-memory-leak-in-getmonitorinfo/69408/1 "2026-09-26T20:58:38Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/1d8262218f4d07571502804af66ee9b378a5c1cd>
>
> Fixes https://github.com/libsdl-org/SDL/issues/16385

```diff
From 1d8262218f4d07571502804af66ee9b378a5c1cd Mon Sep 17 00:00:00 2001
From: onesixromcom <[EMAIL REDACTED]>
Date: Sat, 26 Sep 2026 01:55:21 +0300
Subject: [PATCH] x11: fix memory leak in GetMonitorInfo

Fixes https://github.com/libsdl-org/SDL/issues/16385
---
 src/video/x11/SDL_x11modes.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c
index 37068b9508b28..b79527cdd6fde 100644
--- a/src/video/x11/SDL_x11modes.c
+++ b/src/video/x11/SDL_x11modes.c
@@ -586,6 +586,10 @@ static MonitorInfo *GetMonitorInfo(Display *dpy, int screen, RROutput output, bo
                     break;
                 }
             }
+
+ if (props) {
+ X11_XFree(props);
+ }
         }
     }
 

```
