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 632 - Possible memory leak in Windows mouse input handling
Summary: Possible memory leak in Windows mouse input handling
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.0
Hardware: x86 Windows (All)
: P2 critical
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-24 03:35 UTC by Tim Angus
Modified: 2008-11-25 11:00 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 Tim Angus 2008-09-24 03:35:56 UTC
Let me preface this report by saying I haven't actually tried running the code here and it's possible I'm just overlooking something (albeit something not obvious). If this is the case I apologise profusely in advance :).

It looks to me like there is a pretty horrendous memory leak in the handling of WM_INPUT messages in WIN_WindowProc/SDL_win32events.c.

            lpb = SDL_malloc(size * sizeof(LPBYTE));

I can't see the companion SDL_free for this allocation. It is freed by something that the lpb/raw pointer is passed to? And if so is SDL_free used to free it? In any case doing a memory allocation for every mouse event is probably not best practice, regardless of whether it leaks or not.
Comment 1 Tim Angus 2008-10-15 08:18:51 UTC
Looked like this was fixed in r4105.