Re: [ovs-dev] [PATCH] ovsdb-server: Fix memory leak reported by Valgind.

2016-05-14 Thread Ben Pfaff
On Fri, May 13, 2016 at 10:33:07AM -0700, William Tu wrote: > Reported by test 1657: ovsdb-server/add-db and remove-db. > ds_put_format (dynamic-string.c:142) > query_db_remotes (ovsdb-server.c:798) > reconfigure_remotes (ovsdb-server.c:988) > main_loop (ovsdb-server.c:156) > >

Re: [ovs-dev] [PATCH] ovsdb-server: Fix memory leak reported by Valgind.

2016-05-14 Thread Ben Pfaff
On Fri, May 13, 2016 at 09:13:13PM -0500, Ryan Moats wrote: > > +free(remotes_error); > > Shouldn't this be > > if (remotes_error) { > free(remotes_error); > } No. free() is a no-op when passed a NULL pointer. ___ dev mailing list

Re: [ovs-dev] [PATCH] ovsdb-server: Fix memory leak reported by Valgind.

2016-05-13 Thread William Tu
Hi Ryan, Thanks for the comments. I think free() in libc internally will check if remotes_error is NULL or not. Regards, William > > } > > > > +free(remotes_error); > > Shouldn't this be > > if (remotes_error) { > free(remotes_error); > } > > Ryan Moats >

Re: [ovs-dev] [PATCH] ovsdb-server: Fix memory leak reported by Valgind.

2016-05-13 Thread Ryan Moats
"dev" <dev-boun...@openvswitch.org> wrote on 05/13/2016 12:33:07 PM: > From: William Tu <u9012...@gmail.com> > To: dev@openvswitch.org > Date: 05/13/2016 12:33 PM > Subject: [ovs-dev] [PATCH] ovsdb-server: Fix memory leak reported by Valgind. > Sent b

[ovs-dev] [PATCH] ovsdb-server: Fix memory leak reported by Valgind.

2016-05-13 Thread William Tu
Reported by test 1657: ovsdb-server/add-db and remove-db. ds_put_format (dynamic-string.c:142) query_db_remotes (ovsdb-server.c:798) reconfigure_remotes (ovsdb-server.c:988) main_loop (ovsdb-server.c:156) Signed-off-by: William Tu --- ovsdb/ovsdb-server.c | 1 + 1