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

Summary: Memory leak in GL_CreateTexture function
Product: SDL Reporter: Nitz <nitin.j4>
Component: renderAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P2    
Version: 2.0.3   
Hardware: x86   
OS: Linux   
Attachments: Patch for leakage in data->pixels
Patch to fix memory leak in data->pixels

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