Message ID | 7e7ba27a887674df28bbc23b753b58b300981756.1749133911.git.echaudro@redhat.com |
---|---|
State | Accepted |
Commit | b90304bfe75d22d380f81de8081a3813de136b7e |
Delegated to: | aaron conole |
Headers | show |
Series | Various Coverity fixes. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | fail | github build: failed |
Eelco Chaudron via dev <ovs-dev@openvswitch.org> writes: > When duplicate --config-file command-line arguments are passed, > the resources for previously specified file path were not freed. > > This fix ensures unused resources are properly freed while > preserving the existing behavior of using the last configuration > file path specified. > > Signed-off-by: Eelco Chaudron <echaudro@redhat.com> > --- I got a bit of confusion with config_file_path variable itself, but noticed it was static so should be always either initialized or NULL. Acked-by: Aaron Conole <aconole@redhat.com>
On 05/06/2025 17:51, Eelco Chaudron via dev wrote: > When duplicate --config-file command-line arguments are passed, > the resources for previously specified file path were not freed. > > This fix ensures unused resources are properly freed while > preserving the existing behavior of using the last configuration > file path specified. > > Signed-off-by: Eelco Chaudron <echaudro@redhat.com> > --- > ovsdb/ovsdb-server.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c > index a247ae8f0..d322cdc3d 100644 > --- a/ovsdb/ovsdb-server.c > +++ b/ovsdb/ovsdb-server.c > @@ -2747,6 +2747,7 @@ parse_options(int argc, char *argv[], > break; > > case OPT_CONFIG_FILE: > + free(config_file_path); > config_file_path = abs_file_name(ovs_dbdir(), optarg); > add_default_db = false; > break; thanks Acked-by: Roi Dayan <roid@nvidia.com>
On 9 Jun 2025, at 14:12, Roi Dayan wrote: > On 05/06/2025 17:51, Eelco Chaudron via dev wrote: >> When duplicate --config-file command-line arguments are passed, >> the resources for previously specified file path were not freed. >> >> This fix ensures unused resources are properly freed while >> preserving the existing behavior of using the last configuration >> file path specified. >> >> Signed-off-by: Eelco Chaudron <echaudro@redhat.com> > thanks > > Acked-by: Roi Dayan <roid@nvidia.com> Thanks for the review Aaron and Roi! Applied to main. //Eelco
diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index a247ae8f0..d322cdc3d 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -2747,6 +2747,7 @@ parse_options(int argc, char *argv[], break; case OPT_CONFIG_FILE: + free(config_file_path); config_file_path = abs_file_name(ovs_dbdir(), optarg); add_default_db = false; break;
When duplicate --config-file command-line arguments are passed, the resources for previously specified file path were not freed. This fix ensures unused resources are properly freed while preserving the existing behavior of using the last configuration file path specified. Signed-off-by: Eelco Chaudron <echaudro@redhat.com> --- ovsdb/ovsdb-server.c | 1 + 1 file changed, 1 insertion(+)