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 2657 - Memory leak in GL_CreateTexture function
Summary: Memory leak in GL_CreateTexture function
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: 2.0.3
Hardware: x86 Linux
: P2 critical
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-21 05:18 UTC by Nitz
Modified: 2014-07-26 23:52 UTC (History)
0 users

See Also:


Attachments
Patch for leakage in data->pixels (447 bytes, text/plain)
2014-07-21 05:18 UTC, Nitz
Details
Patch to fix memory leak in data->pixels (494 bytes, patch)
2014-07-25 10:11 UTC, Nitz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nitz 2014-07-21 05:18:59 UTC
Created attachment 1780 [details]
Patch for leakage in data->pixels

In GL_CreateTexture function:

if (GL_CheckError("glGenTexures()", renderer) < 0) {
        SDL_free(data);
        return -1;
    }

Here only data is getting free but data->pixels getting leak.
So have to free data->pixels before free data.

Thanks...
Comment 1 Nitz 2014-07-25 10:11:57 UTC
Created attachment 1787 [details]
Patch to fix memory leak in data->pixels
Comment 2 Sam Lantinga 2014-07-26 23:52:56 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/c3591f14ab7e