2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

ovsdb-server: Fix potential memory leak in parse_options().

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.

Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
This commit is contained in:
Eelco Chaudron
2025-06-05 16:51:28 +02:00
parent d1bd62dae5
commit b90304bfe7

View File

@@ -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;