RR(XS): JDK-6969276 minor memory leak detected by cppcheck in agent/src/os/linux/symtab.c

Dmitry Samersoff dmitry.samersoff at oracle.com
Mon Nov 25 11:53:38 PST 2013


Thank you for the review.

Actually, I don't see a reason to use malloc here - UNIX path is limited
to 1024 bytes so it's possible to just allocate on-stack buffer and use
snprintf to make sure we don't overflow it.

But it's out of scope of this simple fix.


On 2013-11-25 23:46, serguei.spitsyn at oracle.com wrote:
> It looks good.
> Checking 'name' instead of 'debug_name' before 'debug_name' is allocated
> would be even better.
> But it'd be a multi-line fix. :)
> Thanks,
> Serguei
> On 11/25/13 9:49 AM, Dmitry Samersoff wrote:
>> Hi Everyone,
>> Please review an XS fix - missed free() call discovered by cppcheck tool.
>> http://cr.openjdk.java.net/~dsamersoff/JDK-6969276/webrev.01/
>> -Dmitry

Dmitry Samersoff
Oracle Java development team, Saint Petersburg, Russia
* I would love to change the world, but they won't give me the sources.

More information about the serviceability-dev mailing list