[ovs-dev] [PATCH 4/4] util: Fix potential leak of memory.

William Tu u9012063 at gmail.com
Mon Oct 30 19:55:09 UTC 2017

On Mon, Oct 30, 2017 at 12:49 PM, Ben Pfaff <blp at ovn.org> wrote:
> On Mon, Oct 30, 2017 at 10:27:55AM -0700, William Tu wrote:
>> Clang reports potiential leak of memory pointed to by 'pname'.
>> We already free the previous subporgram name when setting the
>> new subprogram name, and once the running thread exits, the
>> name of the process will be free by the system.  Thus, we don't
>> need to explicitly free it, so exclude the clang analyzer as a
>> workaround.
>> Signed-off-by: William Tu <u9012063 at gmail.com>
> Thanks for reporting this.
> I don't think it's worthwhile adding an #if to satisfy clang-analyzer
> here.  I don't think it should be our goal to make clang-analyzer
> produce no output; it does not have enough context to understand
> everything that OVS does.

Hi Ben,
Thanks for the review. Yes, I agree clang-analyzer in many cases
doesn't have enough context. I will leave these warnings there.

More information about the dev mailing list