diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c index 477ad0a1f21..778dd4337c9 100644 --- a/ovn/controller/ovn-controller.c +++ b/ovn/controller/ovn-controller.c @@ -102,14 +102,15 @@ get_core_config(struct controller_ctx *ctx) while (1) { const struct ovsrec_bridge *br_int; - const char *remote, *system_id; + const char *remote, *system_id, *br_int_name; ovsdb_idl_run(ctx->ovs_idl); - ctx->br_int_name = smap_get(&cfg->external_ids, "ovn-bridge"); - if (!ctx->br_int_name) { - ctx->br_int_name = DEFAULT_BRIDGE_NAME; + br_int_name = smap_get(&cfg->external_ids, "ovn-bridge"); + if (!br_int_name) { + br_int_name = DEFAULT_BRIDGE_NAME; } + ctx->br_int_name = xstrdup(br_int_name); br_int = get_bridge(ctx, ctx->br_int_name); if (!br_int) { @@ -240,6 +241,8 @@ main(int argc, char *argv[]) ovsdb_idl_destroy(ctx.ovs_idl); ovsdb_idl_destroy(ctx.ovnsb_idl); + free(ctx.br_int_name); + exit(retval); } diff --git a/ovn/controller/ovn-controller.h b/ovn/controller/ovn-controller.h index 9d2fb3928f3..a1630f7680f 100644 --- a/ovn/controller/ovn-controller.h +++ b/ovn/controller/ovn-controller.h @@ -19,7 +19,7 @@ struct controller_ctx { char *chassis_id; /* ID for this chassis. */ - const char *br_int_name; /* Name of local integration bridge. */ + char *br_int_name; /* Name of local integration bridge. */ struct ovsdb_idl *ovnsb_idl; struct ovsdb_idl *ovs_idl;