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 - [PATCH] Fix memory leaks in IMG_xpm.c
Summary: [PATCH] Fix memory leaks in IMG_xpm.c
Status: RESOLVED FIXED
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: 1.2.10
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-07 00:19 UTC by Joshua Beck
Modified: 2011-08-24 23:25 UTC (History)
1 user (show)

See Also:


Attachments
Patch that fixes the memory leaks against current hg (1.21 KB, patch)
2011-08-07 00:19 UTC, Joshua Beck
Details | Diff
Patch that fixes the memory leaks against current hg, and compiles (1.53 KB, patch)
2011-08-09 16:28 UTC, Joshua Beck
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.