json_object *json_export_vrfs = NULL;
json = json_object_new_object();
- json_import_vrfs = json_object_new_array();
- json_export_vrfs = json_object_new_array();
/* Provide context for the block */
json_object_string_add(json, "vrf", name ? name : "default");
BGP_CONFIG_VRF_TO_VRF_IMPORT)) {
json_object_string_add(json, "importFromVrfs", "none");
json_object_string_add(json, "importRts", "none");
- json_object_free(json_import_vrfs);
} else {
+ json_import_vrfs = json_object_new_array();
+
for (ALL_LIST_ELEMENTS_RO(
bgp->vpn_policy[afi].import_vrf,
node, vname))
json_object_string_add(json, "routeDistinguisher",
"none");
json_object_string_add(json, "exportRts", "none");
- json_object_free(json_export_vrfs);
} else {
+ json_export_vrfs = json_object_new_array();
+
for (ALL_LIST_ELEMENTS_RO(
bgp->vpn_policy[afi].export_vrf,
node, vname))