[ovs-dev] [PATCH ovn] dbctl: Fix a couple of memory leaks

2023-02-22 Thread Ales Musil
Nothing is being freed wherever we are calling ctl_fatal which is fine because the program is about to shutdown anyway however one of the leaks was caught by address sanitizer. Fix most of the leaks that are happening before call to ctl_fatal. Direct leak of 64 byte(s) in 1 object(s) allocated fro

Re: [ovs-dev] [PATCH ovn] dbctl: Fix a couple of memory leaks

2023-02-22 Thread Simon Horman
On Wed, Feb 22, 2023 at 09:02:10AM +0100, Ales Musil wrote: > Nothing is being freed wherever we are calling > ctl_fatal which is fine because the program is > about to shutdown anyway however one of the > leaks was caught by address sanitizer. > Fix most of the leaks that are happening before > ca

Re: [ovs-dev] [PATCH ovn] dbctl: Fix a couple of memory leaks

2023-02-22 Thread Ales Musil
On Wed, Feb 22, 2023 at 10:59 AM Simon Horman wrote: > On Wed, Feb 22, 2023 at 09:02:10AM +0100, Ales Musil wrote: > > Nothing is being freed wherever we are calling > > ctl_fatal which is fine because the program is > > about to shutdown anyway however one of the > > leaks was caught by address

Re: [ovs-dev] [PATCH ovn] dbctl: Fix a couple of memory leaks

2023-02-22 Thread Simon Horman
On Wed, Feb 22, 2023 at 11:24:04AM +0100, Ales Musil wrote: > On Wed, Feb 22, 2023 at 10:59 AM Simon Horman > wrote: ... Hi Ales, > Hi Simon, > thank you for your review. you are welcome. > > > --- > > > utilities/ovn-dbctl.c | 76 +++ > > > 1 file cha

Re: [ovs-dev] [PATCH ovn] dbctl: Fix a couple of memory leaks

2023-02-22 Thread Ilya Maximets
+ +if (cmd_result) { +free(cmd_result); +} + +if (cmd_error) { +free(cmd_error); +} >>> >>> I don't think the cmd_result and cmd_error conditions are required >>> as free should do nothing when passed NULL. >>> >> >> Isn't free

Re: [ovs-dev] [PATCH ovn] dbctl: Fix a couple of memory leaks

2023-02-22 Thread Ales Musil
On Wed, Feb 22, 2023 at 1:38 PM Ilya Maximets wrote: > + > +if (cmd_result) { > +free(cmd_result); > +} > + > +if (cmd_error) { > +free(cmd_error); > +} > >>> > >>> I don't think the cmd_result and cmd_error conditions are re