'strdup' leak - unknown reason
Checking my code for leaks using Instruments, i'm getting one show up that I can't figure out the solution for. It's this:
Malloc 48 bytes Responsible library - libsystem_c.dylib Responsible frame - strdup
I've googled this and a few suggestions tell people just to leave it, but submitting to Apple with a leak seems like a stupid thing to do, so I wanted to see if anybody could tell me more about this, or where it could be coming from?
If your code doesn't use strdup() directly, then there are basically two possible reasons for the memory leak to be shown:
- Apple's code has a bug: it calls strdup() but doesn't free its return value after use.
- The debugging tool (Instruments or a command line tool called by it?) you're using falsely detects the memory leak.
In both case, you can file a bug report to Apple.