We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5339 - Minor memory leak in SDL_x11events.c
Summary: Minor memory leak in SDL_x11events.c
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.13
Hardware: All Linux
: P2 trivial
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-03 21:02 UTC by wcodelyokoyt
Modified: 2020-11-09 07:40 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wcodelyokoyt 2020-11-03 21:02:33 UTC
The atom name that X11_GetAtomName() returns never gets freed, which result in a minor memory leak (14 bytes?) every time the user drops a file on a window.
You can see the line in question here:
https://github.com/spurious/SDL-mirror/blob/6b6170caf69b4189c9a9d14fca96e97f09bbcc41/src/video/x11/SDL_x11events.c#L1350

Fix: call XFree on name after the while loop.
Comment 1 Sam Lantinga 2020-11-09 07:40:38 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/f89630148f39