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 2991

Summary: Memory Loss testfilesystem.c file
Product: SDL Reporter: Nitz <nitin.j4>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: HG 2.0   
Hardware: x86   
OS: Linux   
Attachments: Patch for memory loss

Description Nitz 2015-05-21 13:29:16 UTC
Created attachment 2159 [details]
Patch for memory loss

In File testfilesystem.c
  
SDL_GetBasePath() and SDL_GetPrefPath() are used without freeing memory which is returned by these functions

For example:
 SDL_Log("base path: '%s'\n", SDL_GetBasePath());
 SDL_Log("pref path: '%s'\n", SDL_GetPrefPath("libsdl", "testfilesystem"));

Above functions returns memory which is getting leak.

and SDL_Log being used twice for both the functions which is not required.
This is creating confusion so i removed extra code for better understanding

Patch is attached.

Thanks
Nitin
Comment 1 Ryan C. Gordon 2015-06-01 01:51:30 UTC
This patch is now https://hg.libsdl.org/SDL/rev/e8d9c63536f4, thanks!

--ryan.