Re: [Linuxptp-devel] [RFC PATCH 04/15] pmc_common: fix potential memory leak in run_pmc_events()

2020-08-17 Thread Vladimir Oltean
On Wed, Aug 05, 2020 at 04:26:37PM -0700, Jacob Keller wrote: > The subject says "potential" leak, but in fact it looks like we leaked > every single time we succeeded. > [...] > > Ok, so this is a bit confusing, and I think it is right but the commit > message is wrong. > > run_pmc appears to

Re: [Linuxptp-devel] [RFC PATCH 04/15] pmc_common: fix potential memory leak in run_pmc_events()

2020-08-05 Thread Jacob Keller
The subject says "potential" leak, but in fact it looks like we leaked every single time we succeeded. On 8/1/2020 10:46 AM, Vladimir Oltean wrote: > The convention in all other parts of the code that call run_pmc() is to > free the management PTP message if an error code was returned, or pass > t

[Linuxptp-devel] [RFC PATCH 04/15] pmc_common: fix potential memory leak in run_pmc_events()

2020-08-01 Thread Vladimir Oltean
The convention in all other parts of the code that call run_pmc() is to free the management PTP message if an error code was returned, or pass the message to the caller otherwise. run_pmc_events() wasn't doing that, and was leaking a reference to the message, while also discarding the return code