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 - Memory Loss testfilesystem.c file
Summary: Memory Loss testfilesystem.c file
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: x86 Linux
: P2 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-21 13:29 UTC by Nitz
Modified: 2015-06-01 01:51 UTC (History)
0 users

See Also:


Attachments
Patch for memory loss (808 bytes, patch)
2015-05-21 13:29 UTC, Nitz
Details | Diff

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