# SDL: Fixed memory leak looking up pen tool names

**URL:** <https://discourse.libsdl.org/t/sdl-fixed-memory-leak-looking-up-pen-tool-names/57589>\
**Category:** SDL Commits\
**Created:** [February 5, 2025, 7:59am UTC](https://discourse.libsdl.org/t/sdl-fixed-memory-leak-looking-up-pen-tool-names/57589 "2025-02-05T07:59:22Z")\
**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:** [February 5, 2025, 7:59am UTC](https://discourse.libsdl.org/t/sdl-fixed-memory-leak-looking-up-pen-tool-names/57589/1 "2025-02-05T07:59:22Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/8ba8cca69bc468c9f9a6054aa6a383ade9bd39a2>

```diff
From 8ba8cca69bc468c9f9a6054aa6a383ade9bd39a2 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 4 Feb 2025 23:59:08 -0800
Subject: [PATCH] Fixed memory leak looking up pen tool names

---
 src/video/x11/SDL_x11pen.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/video/x11/SDL_x11pen.c b/src/video/x11/SDL_x11pen.c
index d382eee7013ab..c7e4c8bba6f05 100644
--- a/src/video/x11/SDL_x11pen.c
+++ b/src/video/x11/SDL_x11pen.c
@@ -85,6 +85,7 @@ static bool X11_XInput2PenIsEraser(SDL_VideoDevice *_this, int deviceid, char *d
                     result = true;
                 }
                 X11_XFree(tooltype_name_info);
+ X11_XFree(tooltype_name);
 
                 return result;
             }

```
