[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: RR(XS): JDK-6969276 minor memory leak detected by cppcheck in agent/src/os/linux/symtab.c
From:       Dmitry Samersoff <dmitry.samersoff () oracle ! com>
Date:       2013-11-29 23:08:32
Message-ID: 52991E70.8030800 () oracle ! com
[Download RAW message or body]

Ivan,

Good catch.
Thank you!

-Dmitry

On 2013-11-30 00:59, Ivan Gerasimov wrote:
> Hi Dmitry!
> 
> I think you should surround the if body with braces, or you'll get
> unconditional return from the function otherwise.
> 
>  217   if (last_slash == NULL)
>  218     free(debug_pathname);
>  219     return -1;
> 
> 
> Should be
> 
>  217   if (last_slash == NULL) {
>  218     free(debug_pathname);
>  219     return -1;
>  220   } 
> 
> 
> Sincerely yours,
> Ivan
> 
> 
> On 25.11.2013 21:49, 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.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic