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 1268

Summary: [PATCH] Fix memory leaks in IMG_xpm.c
Product: SDL_image Reporter: Joshua Beck <b10654934>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: 1.2.10   
Hardware: All   
OS: All   
Attachments: Patch that fixes the memory leaks against current hg
Patch that fixes the memory leaks against current hg, and compiles

Description Joshua Beck 2011-08-07 00:19:51 UTC
Created attachment 669 [details]
Patch that fixes the memory leaks against current hg

cppcheck found these errors in SDL_image:

[IMG_xpm.c:262]: (error) Common realloc mistake: 'linebuf' nulled but not freed upon failure
[IMG_xpm.c:280]: (error) Common realloc mistake: 'linebuf' nulled but not freed upon failure
[IMG_xpm.c:127]: (error) Memory leak: hash.table

The included patch fixes all of them.
Comment 1 Joshua Beck 2011-08-09 16:28:01 UTC
Created attachment 672 [details]
Patch that fixes the memory leaks against current hg, and compiles
Comment 2 Ryan C. Gordon 2011-08-24 23:25:14 UTC
This patch is now hg changeset bb611e7cb1e5, thanks!

--ryan.